Browse Source

Merge remote-tracking branch 'origin/master'

林海涛 1 year ago
parent
commit
05a586fad0

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

@@ -396,11 +396,11 @@ class ServiceOrderLogic extends BaseLogic
                 }
                 }
                 $service_work->work_total = $order_total;
                 $service_work->work_total = $order_total;
             }
             }
-            $service_work->save();
+            $service_work->finished_time = time();
 
 
+            $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,

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

@@ -120,7 +120,6 @@ class PayNotifyLogic extends BaseLogic
                     $work->service_status = 3;
                     $work->service_status = 3;
                 }
                 }
                 $work->work_pay_status = 1;
                 $work->work_pay_status = 1;
-                $work->finished_time = time();
                 $work->save();
                 $work->save();
             }
             }
         }
         }

+ 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;
     }
     }
 
 
 }
 }

+ 3 - 3
app/workerapi/lists/IssueWorkLists.php

@@ -23,13 +23,12 @@ class IssueWorkLists extends BaseWorkerDataLists implements ListsSearchInterface
     public function setSearch(): array
     public function setSearch(): array
     {
     {
         return [
         return [
-            '=' => ['work_sn', 'service_work_id', 'master_worker_id', 'issue_approval', 'complaint_status', 'responsible', 'complaint_details', 'finished_time', 'approval_admin_id', 'approval_time', 'create_time', 'update_time'],
+            '=' => ['work_sn', 'service_work_id', 'complaint_status', 'responsible', 'complaint_details', 'finished_time', 'approval_admin_id', 'approval_time', 'create_time', 'update_time'],
         ];
         ];
     }
     }
 
 
     public function querySearch(): array
     public function querySearch(): array
     {
     {
-        $where['issue_approval'] = ['<>',0];
         $where['master_worker_id'] = ['=',$this->userId];
         $where['master_worker_id'] = ['=',$this->userId];
         return $where;
         return $where;
     }
     }
@@ -51,6 +50,7 @@ class IssueWorkLists extends BaseWorkerDataLists implements ListsSearchInterface
         }])
         }])
         ->where($this->searchWhere)
         ->where($this->searchWhere)
             ->where($this->querySearch())
             ->where($this->querySearch())
+            ->where('issue_approval','>',0)
             ->field(['id', 'work_sn', 'service_work_id', 'issue_approval', 'complaint_status', 'responsible', 'complaint_details', 'complaint_images', 'finished_time', 'create_time', 'update_time'])
             ->field(['id', 'work_sn', 'service_work_id', 'issue_approval', 'complaint_status', 'responsible', 'complaint_details', 'complaint_images', 'finished_time', 'create_time', 'update_time'])
             ->limit($this->limitOffset, $this->limitLength)
             ->limit($this->limitOffset, $this->limitLength)
             ->order(['id' => 'desc'])
             ->order(['id' => 'desc'])
@@ -66,7 +66,7 @@ class IssueWorkLists extends BaseWorkerDataLists implements ListsSearchInterface
      */
      */
     public function count(): int
     public function count(): int
     {
     {
-        return IssueWork::where($this->searchWhere)->where($this->querySearch())->count();
+        return IssueWork::where($this->searchWhere)->where($this->querySearch())->where('issue_approval','>',0)->count();
     }
     }
 
 
 }
 }