Преглед изворни кода

工单详情质保金显示问题

whitefang пре 1 година
родитељ
комит
507df34f3f
1 измењених фајлова са 8 додато и 0 уклоњено
  1. 8 0
      app/adminapi/logic/works/ServiceWorkLogic.php

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

@@ -19,6 +19,7 @@ use app\api\logic\PerformanceLogic;
 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\performance\PerformanceRules;
 use app\common\model\recharge\OrderGoods;
 use app\common\model\recharge\RechargeOrder;
@@ -490,6 +491,13 @@ class ServiceWorkLogic extends BaseLogic
 
         //查收工程师提成金额
         $result['change_amount'] = MasterWorkerAccountLog::where(['work_sn'=>$result['work_sn'],'action'=>1])->value('change_amount');
+
+        //质保金相关金额
+        $result['retention'] = MasterWorkerRetentionMoneyLog::where('work_id',$result['id'])->visible(['action','amount'])->select()
+            ->each(function ($item){
+                $item['amount'] = $item['action'] == 1 ? '+'.$item['amount'] : '-'.$item['amount'];
+            })->toArray();
+
         return  $result;
     }