|
|
@@ -255,6 +255,30 @@ class MeiTuanNotifyController extends BaseApiController
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ //结算工单
|
|
|
+ $work = ServiceWork::where('id',$order['work_id'])->findOrEmpty();
|
|
|
+ if(!$work->isEmpty()){
|
|
|
+ $order->verifyStatus = 2;
|
|
|
+ $order->save();
|
|
|
+ $work->work_pay_status = WorkEnum::IS_PAY_STATUS;
|
|
|
+ $orders = \app\common\model\orders\RechargeOrder::where(['work_id'=>$order['work_id']])->select()->toArray();
|
|
|
+ $order_total = 0;
|
|
|
+ $order_amount = 0;
|
|
|
+ foreach ($orders as $k=>$v){
|
|
|
+ $order_total += $v['order_total'];
|
|
|
+ $order_amount += $v['order_amount'];
|
|
|
+ }
|
|
|
+ $work->work_total = $order_total;
|
|
|
+ $work->work_amount = $order_amount;
|
|
|
+ $work->work_status = 7;
|
|
|
+ $work->user_confirm_status = 5;
|
|
|
+ $work->service_status = 3;
|
|
|
+ $work->work_pay_status = 1;
|
|
|
+ $work->finished_time = time();
|
|
|
+ $work->save();
|
|
|
+ ThirdOrderLogic::updateorderfulfillinfo($work,ThirdTypeEnum::MEITUAN_COMPLETION);
|
|
|
+ }
|
|
|
}
|
|
|
Db::commit();
|
|
|
}catch(\Exception $e){
|