Explorar o código

Merge branch 'master' into Haozi

# Conflicts:
#	database/migrations/2020_08_28_134321_change_ids_of_tables_not_int.php
haozi %!s(int64=5) %!d(string=hai) anos
pai
achega
e162d80e52

+ 1 - 1
app/Http/Controllers/OrderIssuePerformanceController.php

@@ -13,7 +13,7 @@ class OrderIssuePerformanceController extends Controller
         }
         $service  = app('orderIssuePerformanceService');
         $performance = $service->paginate($request->all());
-        $options = ['timeFrame'=>$request->input('timeFrame'),'create_start'=>$request->input('create_start')??'','create_end'=>$request->input['create_end']??''];
+        $options = ['timeFrame'=>$request->input('timeFrame'),'create_start'=>$request->input('create_start')??'','create_end'=>$request->input('create_end')??''];
         return view('order.issue.performance',compact('performance','options'));
     }
     public function export(Request $request){

+ 17 - 15
app/Services/OrderIssueService.php

@@ -88,15 +88,15 @@ class OrderIssueService
                     $query->where('logistic_number', $logistic_number);
                 });
             }
-            if(($arr['good_barcode'] ?? false) ||($arr['good_name'] ?? false)){
-                $query->whereHas('packages',function($query) use ($arr){
-                    $query->whereHas('commodities',function($query) use ($arr){
-                        $query->whereHas('commodity',function($query) use ($arr){
-                            if($arr['good_barcode'] ?? false){
-                                $query->where('sku',$arr['good_barcode']);
+            if (($arr['good_barcode'] ?? false) || ($arr['good_name'] ?? false)) {
+                $query->whereHas('packages', function ($query) use ($arr) {
+                    $query->whereHas('commodities', function ($query) use ($arr) {
+                        $query->whereHas('commodity', function ($query) use ($arr) {
+                            if ($arr['good_barcode'] ?? false) {
+                                $query->where('sku', $arr['good_barcode']);
                             }
-                            if($arr['good_name'] ?? false){
-                                $query->where('name',$arr['good_name']);
+                            if ($arr['good_name'] ?? false) {
+                                $query->where('name', $arr['good_name']);
                             }
                         });
                     });
@@ -142,8 +142,8 @@ class OrderIssueService
             $query->where('order_issue_type_id', $condition['order_issue_type_id']);
         }
         if (!($condition['is_handle'] ?? false) && !($condition['final_status'] ?? false)) {
-            $query->where(function ($query){
-                $query->where('final_status','<>','已解决')->orWhereNull('final_status');
+            $query->where(function ($query) {
+                $query->where('final_status', '<>', '已解决')->orWhereNull('final_status');
             });
         }
         if (isset($condition['logistic_indemnity_money'])) {
@@ -213,11 +213,13 @@ class OrderIssueService
             if ($rejectedBill) {
                 $orderIssue->rejected_bill_id = $rejectedBill['id'];
                 $orderIssue->save();
-            }else {
-                $rejectedBill =  RejectedBill::where('order_number',$orderHeader['orderNo'])->first();
-                if($rejectedBill){
-                    $orderIssue->rejected_bill_id = $rejectedBill['id'];
-                    $orderIssue->save();
+            } else {
+                if ($orderHeader['orderno']) {
+                    $rejectedBill = RejectedBill::where('order_number', $orderHeader['orderno'])->first();
+                    if ($rejectedBill) {
+                        $orderIssue->rejected_bill_id = $rejectedBill['id'];
+                        $orderIssue->save();
+                    }
                 }
             }
         }

+ 2 - 2
app/Services/OrderService.php

@@ -44,12 +44,12 @@ class OrderService
                 $shop = Shop::firstOrCreate(['name' => $shop_name, 'owner_id' => $owner_id]);
                 $shop_Id = $shop['id'];
             }
-            $logistics = Logistic::where(['name' => $orderHeadAttr['carriername']])->first();
+            $logistics = Logistic::where(['code' => $orderHeadAttr['carrierid']])->first();
             $logistics_id = null;
             if ($logistics) {
                 $logistics_id = $logistics['id'];
             } else {
-                $logistics = Logistic::create(['name'=>$orderHeadAttr['carriername'],'code'=>$orderHeadAttr['CARRIERID']]);
+                $logistics = Logistic::create(['name'=>$orderHeadAttr['carriername'],'code'=>$orderHeadAttr['carrierid']]);
                 $logistics_id = $logistics['id'];
             }
             $arr = [

+ 47 - 0
database/migrations/2020_08_28_134321_change_ids_of_tables_not_int.php

@@ -0,0 +1,47 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\DB;
+use Illuminate\Support\Facades\Schema;
+
+class ChangeIdsOfTablesNotInt extends Migration
+{
+
+
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('signs', function (Blueprint $table) {
+            $table->bigInteger('signable_id')->change();
+        });
+        Schema::table('commodity_barcodes', function (Blueprint $table) {
+            $table->bigInteger('commodity_id')->change();
+        });
+        Schema::table('custom_fields', function (Blueprint $table) {
+            $table->bigInteger('authority_id')->change();
+        });
+        Schema::table('orders', function (Blueprint $table) {
+            $table->bigInteger('batch_id')->change();
+        });
+        Schema::table('order_issues', function (Blueprint $table) {
+            $table->bigInteger('order_issue_type_id')->nullable()->change();
+        });
+        Schema::table('shops', function (Blueprint $table) {
+            $table->bigInteger('owner_id')->change();
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+    }
+}

+ 2 - 1
resources/views/order/issue/performance.blade.php

@@ -71,6 +71,7 @@
                     timeFrame:'{{$options['timeFrame']}}',
                     create_start:'{{$options['create_start']}}',
                     create_end:'{{$options['create_end']}}',
+
                 },
                 checkData:[],
             },
@@ -98,7 +99,7 @@
                     }
                 },
                 exportAll:function(){
-                    let search = '?timeFrame='+this.option.timeFrame+'&create_start='+this.option.create_start+'&create_end'+this.option.create_end;
+                    let search = '?timeFrame='+this.option.timeFrame+'&create_start='+this.option.create_start+'&create_end='+this.option.create_end;
                     let url = '{{url('orderIssuePerformance/export')}}'+search;
                     let token='{{ csrf_token() }}';
                     excelExport(false,'',url,null,token);