Просмотр исходного кода

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

LD 5 лет назад
Родитель
Сommit
0b0bfe0213

+ 7 - 22
app/Http/Controllers/TestController.php

@@ -180,28 +180,6 @@ class TestController extends Controller
     }
     public function test()
     {
-        DeliveryAppointment::query()->where("created_at",">=","2021-05-17 00:00:00")
-            ->whereNotNull("asn_number")->get()->each(function ($model){
-            $asn = preg_split('/[,, ]+/is', $model->asn_number);
-            $query = Store::query()->whereIn("asn_code",$asn);
-            if ($model->owner_id)$query->where("owner_id",$model->owner_id);
-            $stores = $query->with("storeItems")->get();
-            if ($stores){
-                $items = [];
-                $stores->each(function ($store)use(&$items){
-                    if ($store->storeItems)foreach($store->storeItems as $it){
-                        $items[] = [
-                            "name"=>"",
-                            "amount"=>$it->amount,
-                            "bar_code"=>"",
-                            "commodity_id"=>$it->commodity_id,
-                        ];
-                    }
-                });
-                app("DeliveryAppointmentService")->insertDetails($model,$items);
-            }
-        });
-        dd("OK");
         $asnno = "ASN2105141388";
         $query = DB::raw("SELECT b.ALTERNATE_SKU1,h.WAREHOUSEID,h.asnno,d.ASNLINENO,d.SKUDESCRC,h.CUSTOMERID,d.SKU,d.PACKID,d.RECEIVEDQTY_EACH,d.EXPECTEDQTY_EACH,d.LOTATT01,d.LOTATT02,d.lotatt04,".
             "d.lotatt05,d.lotatt08,d.USERDEFINE1,d.USERDEFINE2,d.USERDEFINE3,d.USERDEFINE4,d.USERDEFINE5,d.RECEIVINGLOCATION FROM DOC_ASN_DETAILS d ".
@@ -241,6 +219,13 @@ class TestController extends Controller
         $ser->createInstantBill($store);
         dd($store);
     }
+    public function orderCreateBill()
+    {
+        $order = Order::query()->find(\request("id"));
+        $ser = new OrderService();
+        $ser->createInstantBill($order);
+        dd("order create bill success");
+    }
     public function supplementMarchOwnerReport()
     {
         $ows = OwnerAreaReport::query()->select("owner_id")->where("counting_month",'like',"2021-03%")->get();

+ 0 - 3
app/Providers/AuthServiceProvider.php

@@ -40,9 +40,6 @@ class AuthServiceProvider extends ServiceProvider
     public function boot()
     {
         $this->registerPolicies();
-        Gate::before(function ($user) {
-            return true;
-        });
         $isSuperAdmin = null;
         if(!Schema::hasTable('users')){return;}
         /** @var CacheService $cacheService */

+ 2 - 2
app/Services/OwnerPriceOperationService.php

@@ -445,7 +445,7 @@ class OwnerPriceOperationService
                     $money = $rule->unit_price;
                     $matchObject=$this->settingCount($matchObject,$columnMapping[8],$startNumber);
                 }
-                if ($matchObject)foreach ($matchObject as $package)$money += $package[$columnMapping[8]] * $package["price"];
+                if ($matchObject)foreach ($matchObject as $package)if ($package["price"] ?? false)$money += $package[$columnMapping[8]] * $package["price"];
                 if (!$startNumber && $money<$rule->unit_price)$money = $rule->unit_price;
                 return $money+$surcharge;
             }
@@ -475,7 +475,7 @@ class OwnerPriceOperationService
         }
         if ($matchObject){
             $money = $surcharge;
-            foreach ($matchObject as $package)if ($package["price"])$money += $package[$columnMapping[8]] * $package["price"];
+            foreach ($matchObject as $package)if ($package["price"] ?? false)$money += $package[$columnMapping[8]] * $package["price"];
         }
         return $money ?? -7;
     }