Browse Source

同步packages

LD 5 năm trước cách đây
mục cha
commit
2d535a51b7

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

@@ -44,7 +44,6 @@ class TestController extends Controller
 
     function packageFromLog(Request $request)
     { //x        $packagesBatch=Package::where('batch_number',$batch_number)->first();
-
         ini_set('max_execution_time', 2500);
         ini_set('memory_limit', '1526M');
         $uploaded = 0;

+ 2 - 2
app/Http/Controllers/api/thirdPart/flux/ProcessController.php

@@ -43,7 +43,7 @@ class ProcessController extends Controller
         }
         $docOrders=OracleDOCOrderDetail::where("OrderNo",$wms_code)->get();//出库单
         if (count($docOrders)>0){
-            $owners=Owner::withTrashed()->where("code",$docOrders[0]->customerid)->get();
+            $owners=Owner::query()->where("code",$docOrders[0]->customerid)->get();
             if ($owners->isEmpty()){
                 $owner=$this->storeOwner($docOrders[0]->customerid);
             }else{
@@ -156,7 +156,7 @@ class ProcessController extends Controller
         $commodityBarCodeData=[];
         $commodityBarCodeTem=[];
         $owners_code=array_column($oracleBasSkus->toArray(),'customerid');
-        $ownersTem=Owner::withTrashed()->whereIn('code',$owners_code)->get();
+        $ownersTem=Owner::query()->whereIn('code',$owners_code)->get();
         $owners=array_column($ownersTem->toArray(),'id','code');
         for($i=0;$i<count($oracleBasSkus);$i++){
             if (!$owners[$oracleBasSkus[$i]->customerid])$owners[$oracleBasSkus[$i]->customerid]=$this->storeOwner($oracleBasSkus[$i]->customerid);

+ 1 - 1
app/Services/OwnerService.php

@@ -28,7 +28,7 @@ Class OwnerService
         $ownerCount=Owner::count();
         if(count($basCustomers)==$ownerCount)return null;
         foreach ($basCustomers as $basCustomer){
-           $owner=Owner::withTrashed()->where('code',$basCustomer['customerid'])->first();
+           $owner=Owner::query()->where('code',$basCustomer['customerid'])->first();
            if (!isset($owner))
                Owner::query()->create([
               'code'=> $basCustomer['customerid'],

+ 33 - 0
database/migrations/2020_09_10_143926_drop_shop_unique_name_index.php

@@ -0,0 +1,33 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+class DropShopUniqueNameIndex extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('shops', function (Blueprint $table) {
+            $table->dropIndex('shops_name_unique');
+            $table->string('name')->index()->change();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('shops', function (Blueprint $table) {
+            $table->string('name')->unique();
+        });
+    }
+}