ソースを参照

Merge branch 'zengjun' of ssh://was.baoshi56.com:10022/var/git/bswas

 Conflicts:
	app/Http/Controllers/TestController.php
LD 5 年 前
コミット
e425864590

+ 13 - 1
app/Http/Controllers/TestController.php

@@ -1522,7 +1522,9 @@ TEXT;
 
     public function orderPackageUnique()
     {
-        $orderPackages = OrderPackage::query()->whereIn('id','>=','15900000')->groupBy('logistic_number')->get();
+        // select logistic_number,count(1) counts from order_packages where id >= 1590001   GROUP BY logistic_number HAVING counts > 1;
+        $orderPackages = OrderPackage::query()->selectRaw('count(1) counts,logistic_number')->where('id','>=','1590000')->groupBy('logistic_number')->having('counts','>','1')->get();
+        dd($orderPackages);
         foreach ($orderPackages as $orderPackage) {
             $items = OrderPackage::query()->where('logistic_number',$orderPackage['logistic_number'])->get();
             $orderPackage = $items->first();
@@ -1537,6 +1539,10 @@ TEXT;
                 $orderPackage['measuring_machine_id'] = $item['measuring_machine_id'] ?? $orderPackage['measuring_machine_id'];
                 $orderPackage['weighed_at'] = $item['weighed_at'] ?? $orderPackage['weighed_at'];
                 $orderPackage['owner_id'] = $item['owner_id'] ?? $orderPackage['owner_id'];
+                $orderPackage['received_at'] = $item['received_at'] ?? $orderPackage['received_at'];
+                $orderPackage['transfer_status'] = $item['transfer_status'] ?? $orderPackage['transfer_status'];
+                $orderPackage['status'] = $item['status'] != '无' ? $item['status'] : $orderPackage['transfer_status'];
+                $orderPackage['uploaded_to_wms'] = $item['uploaded_to_wms'] != '否' ? $item['uploaded_to_wms'] : $orderPackage['transfer_status'];
             }
             $orderPackages_filter = $items->filter(function($item)use($orderPackage){
                 if($orderPackage['id'] === $item['id'])return false;
@@ -1551,6 +1557,12 @@ TEXT;
         }
     }
 
+    public function endStationTask()
+    {
+        $stationTask = StationTask::query()->where('id',711)->first();
+        $stationTask->update(['status'=>'完成']);
+    }
+
     public function order_package_exception_type_counting_record_init()
     {
         /**

+ 2 - 2
app/Http/Controllers/api/thirdPart/haiq/LightController.php

@@ -32,8 +32,8 @@ class LightController
      * @return array
      */
     public function update(Request $request){// 拍灯以后的消息发至此处
-        $station = Station::query()->with('type')->where('code',$request['locCode'])->first();
-        if( $station->type && $station->type->name == '缓存架' ){  // 拍灯 推送任务
+        $station = Station::query()->with('stationType')->where('code',$request['locCode'])->first();
+        if( $station->stationType && $station->stationType->name == '缓存架' ){  // 拍灯 推送任务
             if($request['PTLAction'] !== 0) return ['location' => 200,'errMsg' => 'is cacheShelf','data' => $request->all()];
             /** @var CacheShelfService $cacheShelfService */
             $cacheShelfService = app(CacheShelfService::class);

+ 1 - 1
app/Services/CityService.php

@@ -34,7 +34,7 @@ class CityService
         if(isset($city))return $city;
         if(!$name)return null;
         foreach (CityService::$cities as $city) {
-            if(strstr($city,$name) != null){
+            if(strstr($city,$name) != null || strstr($name,$city)){
                return City::query()->where('name','like',$city.'%')->first();
             }
         }

+ 1 - 1
app/Services/ProvinceService.php

@@ -21,7 +21,7 @@ class ProvinceService
         if(isset($province))return $province;
 
         foreach (ProvinceService::$provinces as $province) {
-            if(strstr($province,$name) != null){
+            if(strstr($province,$name) != null || strstr($name,$province) != null){
                 return Province::query()->where('name',$province)->first();
             }
         }