|
|
|
@ -3344,31 +3344,25 @@ class InsurerController extends BaseController |
|
|
|
|
$row->return_remark = $return_remark; |
|
|
|
|
$row->return_time = time(); |
|
|
|
|
$row->lock_id = 0; |
|
|
|
|
$row->save(); |
|
|
|
|
if(!$row->save()) { |
|
|
|
|
throw new \Exception(print_r($row->getErrors(), true)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//处理操作人员状态 |
|
|
|
|
$order_user_info = OrderUserT::findOne(['order_id'=>$row->id,'user_id'=>$this->my->id,'status'=>0]); |
|
|
|
|
if($order_user_info) { |
|
|
|
|
$order_user_info->status = 2; //退回 |
|
|
|
|
$order_user_info->save(); |
|
|
|
|
if(!$order_user_info->save()) { |
|
|
|
|
throw new \Exception(print_r($order_user_info->getErrors(), true)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$order_user_info2 = new OrderUserT(); |
|
|
|
|
$order_user_info2->user_id = $row->user_id; |
|
|
|
|
$order_user_info2->order_id = $row->id; |
|
|
|
|
$order_user_info2->type_id = 1; |
|
|
|
|
$order_user_info2->status = 0; |
|
|
|
|
$order_user_info2->save(); |
|
|
|
|
} |
|
|
|
|
// |
|
|
|
|
//处理礼品数量 |
|
|
|
|
$sel_gifts = OrderGiftT::find() |
|
|
|
|
->where('order_id='.$order_id) |
|
|
|
|
->all(); |
|
|
|
|
foreach($sel_gifts as $sel_gift) { |
|
|
|
|
$gift_info = $sel_gift->gift; |
|
|
|
|
if($gift_info && $gift_info->total > -1) { |
|
|
|
|
$gift_info->total = $gift_info->total + 1; |
|
|
|
|
$gift_info->save(); |
|
|
|
|
if(!$order_user_info2->save()) { |
|
|
|
|
throw new \Exception(print_r($order_user_info2->getErrors(), true)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|