Przeglądaj źródła

服务完成结算问题

whitefang 1 rok temu
rodzic
commit
9b47ed9787

+ 0 - 2
app/api/logic/ServiceOrderLogic.php

@@ -399,10 +399,8 @@ class ServiceOrderLogic extends BaseLogic
             $service_work->finished_time = time();
             $service_work->finished_time = time();
 
 
             $service_work->save();
             $service_work->save();
-
             //更新师傅的进行工单数量
             //更新师傅的进行工单数量
             MasterWorker::setWorktotal('dec',$service_work->master_worker_id);
             MasterWorker::setWorktotal('dec',$service_work->master_worker_id);
-
             $work_log = [
             $work_log = [
                 'work_id'=>$work_id,
                 'work_id'=>$work_id,
                 'master_worker_id'=>$service_work->master_worker_id,
                 'master_worker_id'=>$service_work->master_worker_id,

+ 7 - 0
app/common/logic/PaymentLogic.php

@@ -201,6 +201,13 @@ class PaymentLogic extends BaseLogic
             return ['sn' => $order['sn'],'need_pay'=>0];
             return ['sn' => $order['sn'],'need_pay'=>0];
         }
         }
 
 
+        //todo 测试订单
+//        if($order['id']==11){
+//            PayNotifyLogic::handle($from, $order['sn']);
+//            return ['sn' => $order['sn'],'need_pay'=>0];
+//        }
+
+
         $payService = null;
         $payService = null;
         switch ($payWay) {
         switch ($payWay) {
             case PayEnum::WECHAT_PAY:
             case PayEnum::WECHAT_PAY:

+ 0 - 1
app/common/logic/WorkerAccountLogLogic.php

@@ -50,7 +50,6 @@ class WorkerAccountLogLogic extends BaseLogic
             'remark' => $remark,
             'remark' => $remark,
             'extra' => $extra ? json_encode($extra, JSON_UNESCAPED_UNICODE) : '',
             'extra' => $extra ? json_encode($extra, JSON_UNESCAPED_UNICODE) : '',
         ];
         ];
-
         MasterWorkerAccountLog::create($data);
         MasterWorkerAccountLog::create($data);
 
 
         $worker->user_money = $left_amount + ($action==1?$changeAmount:-$changeAmount);
         $worker->user_money = $left_amount + ($action==1?$changeAmount:-$changeAmount);

+ 6 - 4
app/common/model/master_worker/MasterWorker.php

@@ -63,20 +63,22 @@ class MasterWorker extends BaseModel
     /**
     /**
      * @param $type [inc=新增,dec=减少]
      * @param $type [inc=新增,dec=减少]
      * @param $worker_id
      * @param $worker_id
-     * @return void
+     * @return bool
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DataNotFoundException
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\DbException
      * @throws \think\db\exception\ModelNotFoundException
      * @throws \think\db\exception\ModelNotFoundException
      */
      */
     public static function setWorktotal($type,$worker_id)
     public static function setWorktotal($type,$worker_id)
     {
     {
-        $worker = MasterWorker::find($worker_id);
+        $worker = MasterWorker::where('id',$worker_id)->findOrEmpty();
         if($type == 'inc'){
         if($type == 'inc'){
-            $worker->inc('work_total',1)->save();
+            $worker->inc('work_total',1);
         }else{
         }else{
             $work_total = $worker->work_total == 0?0:1;
             $work_total = $worker->work_total == 0?0:1;
-            $worker->dec('work_total',$work_total)->save();
+            $worker->dec('work_total',$work_total);
         }
         }
+        $worker->save();
+        return true;
     }
     }
 
 
 }
 }