...
|
...
|
@@ -92,14 +92,33 @@ class AdminOrderController extends AdminBaseController |
|
|
public function operation(){
|
|
|
$data = $this->request->param();
|
|
|
Db::startTrans();
|
|
|
$model = new OrderModel();
|
|
|
// 拒绝
|
|
|
if($data['type'] == 4){
|
|
|
$where_log['type'] = 1;
|
|
|
$where_log['elseId'] = $data['id'];
|
|
|
$isSet = Db::name('Refund')->where($where_log)->find();
|
|
|
if($isSet){
|
|
|
Db::rollback();
|
|
|
$this->apiResponse('0','请勿重复操作!');
|
|
|
$where_findStatus['id'] = $data['id'];
|
|
|
$where_findStatus['status'] = array('neq',4);
|
|
|
$ischange = $model->where($where_findStatus)->find();
|
|
|
if(!$ischange){
|
|
|
Db::rollback();
|
|
|
$this->apiResponse('0','请勿重复操作!');
|
|
|
}else{
|
|
|
$up_order['id'] = $data['id'];
|
|
|
$up_order['status'] = $data['type'];
|
|
|
$up_order['update_time'] = time();
|
|
|
$res = $model->isUpdate(true)->save($up_order);
|
|
|
if(!$res){
|
|
|
Db::rollback();
|
|
|
$this->apiResponse('0','操作失败');
|
|
|
}else{
|
|
|
Db::commit();
|
|
|
$this->apiResponse('1','操作成功');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|
|
|
$add_log['type'] = 1;
|
|
|
$add_log['elseId'] = $data['id'];
|
...
|
...
|
@@ -112,7 +131,7 @@ class AdminOrderController extends AdminBaseController |
|
|
$this->apiResponse('0','操作失败');
|
|
|
}
|
|
|
}
|
|
|
$model = new OrderModel();
|
|
|
|
|
|
// 查询订单
|
|
|
$where_order['id'] = $data['id'];
|
|
|
$where_order['status'] = 2;
|
...
|
...
|
|