...
|
...
|
@@ -513,7 +513,7 @@ class Orders extends Api |
|
|
|
|
|
//查询订单
|
|
|
$status = $this->order_status;
|
|
|
$where = ['id'=>$order_id,'uid'=>$this->uid,'status'=>$status[5]];//待收货
|
|
|
$where = ['id'=>$order_id,'uid'=>$this->uid,'status'=>['in',$status[5],$status[8]]];//待收货,已完成
|
|
|
$order = Common::findSoftWhereData('order',$where,'id');
|
|
|
if($order){
|
|
|
$orderModel = new Order();
|
...
|
...
|
@@ -544,6 +544,7 @@ class Orders extends Api |
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
*
|
|
|
* @ApiParams (name="order_id", type="inter", required=true, description="订单id")
|
|
|
* @ApiParams (name="cancel_flag", type="inter", required=true, description="记录本地缓存的上一个状态(1:原始状态为待收货,2:原始状态为已完成)")
|
|
|
*
|
|
|
* @ApiReturn({
|
|
|
"code": 1,
|
...
|
...
|
@@ -555,10 +556,11 @@ class Orders extends Api |
|
|
public function cancelApplyReturnGoods(){
|
|
|
if($this->request->isGet()){
|
|
|
$order_id = $this->request->get('order_id');
|
|
|
$cancel_flag = $this->request->get('cancel_flag');
|
|
|
|
|
|
$rule = config('verify.order_detail');
|
|
|
$rule = config('verify.return_flag');
|
|
|
$validate = new Validate($rule['rule'],$rule['msg']);
|
|
|
if (!$validate->check(['order_id'=>$order_id])) {
|
|
|
if (!$validate->check(['order_id'=>$order_id,'cancel_flag'=>$cancel_flag])) {
|
|
|
$this->error($validate->getError());
|
|
|
}
|
|
|
|
...
|
...
|
@@ -568,7 +570,14 @@ class Orders extends Api |
|
|
$order = Common::findSoftWhereData('order',$where,'id');
|
|
|
if($order){
|
|
|
$orderModel = new Order();
|
|
|
if($cancel_flag == 1){
|
|
|
$res = $orderModel->where($where)->update(['status'=>$status[5],'return_refund_flag'=>0,'return_reason'=>'']);//待收货
|
|
|
}else if($cancel_flag == 2){
|
|
|
$res = $orderModel->where($where)->update(['status'=>$status[8],'return_refund_flag'=>0,'return_reason'=>'']);//已完成
|
|
|
}else{
|
|
|
$res = false;
|
|
|
}
|
|
|
|
|
|
if($res){
|
|
|
$this->success('撤销成功');
|
|
|
}else{
|
...
|
...
|
|