|
@@ -190,7 +190,13 @@ class Order extends Controller
|
|
|
*/
|
|
|
public function cancel()
|
|
|
{
|
|
|
- $map = $this->_vali(['order_no.require' => '订单号不能为空!',]);
|
|
|
+ //$map = $this->_vali(['order_no.require' => '订单号不能为空!',]);
|
|
|
+ $data = input();
|
|
|
+ $map = [];
|
|
|
+ if(!isset($data['order_no']) || $data == '' || $data == null){
|
|
|
+ $this->error('订单号不能为空!');
|
|
|
+ }
|
|
|
+ $map['order_no'] = $data['order_no'];
|
|
|
$order = ShopOrder::mk()->where($map)->find();
|
|
|
if (empty($order)) $this->error('订单查询异常!');
|
|
|
if (!in_array($order['status'], [1, 2, 3])) $this->error('订单不能取消!');
|
|
@@ -214,4 +220,4 @@ class Order extends Controller
|
|
|
$this->error($exception->getMessage());
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+}
|