瀏覽代碼

采购管理绑定问题

hu hao 5 年之前
父節點
當前提交
4516b7496e

+ 3 - 3
app/Http/Controllers/ProcurementController.php

@@ -370,7 +370,7 @@ class ProcurementController extends Controller
                 $procurement->ownerMaterial->owner ? $procurement->ownerMaterial->owner->name :'',
                 is_null($procurement->type) ? '' :$procurementType[$procurement->type],
                 $procurement->ownerMaterial->owner->customer ? $procurement->ownerMaterial->owner->customer->company_name :'',
-                $procurement->ownerMaterial->material ? $procurement->ownerMaterial->material->code :'',
+                $procurement->ownerMaterial ? $procurement->ownerMaterial->material_code :'',
                 $procurement->ownerMaterial->material ? $procurement->ownerMaterial->material->name :'',
                 $procurement->ownerMaterial ? $procurement->ownerMaterial->size :'',
                 $procurement->ownerMaterial ? $procurement->ownerMaterial->special :'',
@@ -411,7 +411,7 @@ class ProcurementController extends Controller
                 $procurementCheckSheet->procurementDelivery->procurement ? $procurementCheckSheet->procurementDelivery->procurement->created_at :'',
                 $procurementCheckSheet->procurementDelivery ? $procurementCheckSheet->procurementDelivery->created_at :'',
                 $procurementCheckSheet->procurementDelivery->procurement->supplier ? $procurementCheckSheet->procurementDelivery->procurement->supplier->name :'',
-                $procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material ? $procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material->code :'',
+                $procurementCheckSheet->procurementDelivery->procurement->ownerMaterial ? $procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material_code :'',
                 $procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material ? $procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material->name :'',
                 $procurementCheckSheet->procurementDelivery->procurement ? $procurementCheckSheet->procurementDelivery->procurement->quantity :'',
                 $procurementCheckSheet->procurementDelivery ? $procurementCheckSheet->procurementDelivery->amount :'',
@@ -460,7 +460,7 @@ class ProcurementController extends Controller
                 $procurement->ownerMaterial->owner ? $procurement->ownerMaterial->owner->name :'',
                 $procurement->ownerMaterial->owner->customer ? $procurement->ownerMaterial->owner->customer->company_name :'',
                 $procurement->supplier ? $procurement->supplier->name :'',
-                $procurement->ownerMaterial->material ? $procurement->ownerMaterial->material->code :'',
+                $procurement->ownerMaterial ? $procurement->ownerMaterial->material_code :'',
                 $procurement->ownerMaterial->material ? $procurement->ownerMaterial->material->name :'',
                 $procurement->ownerMaterial ? $procurement->ownerMaterial->size :'',
                 $procurement->ownerMaterial ? $procurement->ownerMaterial->special :'',

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

@@ -1264,12 +1264,12 @@ where purch.islower=1 and deliver.id>'.$id);
         }
         ProcurementCheckSheet::query()->insert($insert_);
     }
-
-    public function testAuth()
-    {
-        $user = Auth::user();
-        $authorities = $user->authorities();
-        $authorities = data_get($authorities,'*.id');
-        dd($authorities);
+    public function testPro(){
+        $procurements=Procurement::query()
+            ->withCount('procurementQuotations')
+            ->with('ownerMaterial.material')
+            ->where('status',0)
+            ->get();
+        dd($procurements);
     }
 }

+ 1 - 1
app/Http/Controllers/api/thirdPart/weixin/AuthController.php

@@ -81,7 +81,7 @@ class AuthController extends Controller
         UserDetail::query()
             ->where('user_id',Auth::user()['id'])
             ->update(['procurement_wechat_open_id'=>$resp['openid'],]);
-        return $this->success($resp['openid'],'获取openID成功');
+//        return $this->success($resp['openid'],'获取openID成功');
     }
 
 }

+ 1 - 1
resources/views/procurement/finance/checkBill.blade.php

@@ -82,7 +82,7 @@
                         @if($procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material??'')
                         material_id:'{{$procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material->id ??''}}',
                         material_name:'{{$procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material->name ??''}}',
-                        material_code:'{{$procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material->code ??''}}',@endif
+                        material_code:'{{$procurementCheckSheet->procurementDelivery->procurement->ownerMaterial->material_code ??''}}',@endif
 
                     },
                     @endforeach