瀏覽代碼

add - 工单详情保修卡

liugc 1 年之前
父節點
當前提交
645ab0da98
共有 1 個文件被更改,包括 12 次插入0 次删除
  1. 12 0
      app/adminapi/logic/works/ServiceWorkLogic.php

+ 12 - 0
app/adminapi/logic/works/ServiceWorkLogic.php

@@ -20,6 +20,7 @@ use app\common\model\dict\DictData;
 use app\common\model\master_worker\MasterWorker;
 use app\common\model\master_worker\MasterWorkerAccountLog;
 use app\common\model\master_worker\MasterWorkerRetentionMoneyLog;
+use app\common\model\orders\OrderEffectiveLog;
 use app\common\model\performance\PerformanceRules;
 use app\common\model\recharge\OrderGoods;
 use app\common\model\recharge\RechargeOrder;
@@ -490,6 +491,17 @@ class ServiceWorkLogic extends BaseLogic
             }
             $result['spare_parts'] = array_values($spare_parts)??[];
         }
+        // 保修卡信息
+        $result['order_effectives'] = OrderEffectiveLog::with(['goods'=>function ($query) {
+                                            $query->with(['goodsCategory'=>function ($query1) {
+                                                $query1->field(['name','picture']);
+                                            }]);
+                                        }])->where('work_id',$result['id'])
+                                        ->field(['id','goods_id','sn','effective_unit','effective_num','remark','end_effective_time'])
+                                        ->append(['effective_unit_text'])
+                                        ->order('create_time desc')
+                                        ->select()
+                                        ->toArray();
 
         //查收工程师提成金额
         $change_amount = MasterWorkerAccountLog::where(['work_sn'=>$result['work_sn'],'action'=>1])->value('change_amount');