Authored by cailing

删除订单

@@ -32,6 +32,11 @@ class OrderModel @@ -32,6 +32,11 @@ class OrderModel
32 foreach ($orderInfo['data']['order_list'] as $orderK => $orderV) { 32 foreach ($orderInfo['data']['order_list'] as $orderK => $orderV) {
33 $orders[$orderK]['orderNum'] = $orderV['order_code']; //订单标识 33 $orders[$orderK]['orderNum'] = $orderV['order_code']; //订单标识
34 $orders[$orderK]['orderTime'] = date("Y-m-d H:i:s", $orderV['create_time']); //下单时间 34 $orders[$orderK]['orderTime'] = date("Y-m-d H:i:s", $orderV['create_time']); //下单时间
  35 +// $orders[$orderK]['hasDelete'] = true; //彻底删除
  36 + //删除订单
  37 + if($orderV['is_cancel'] == 'Y' || $orderV['status'] === 6) {
  38 + $orders[$orderK]['canDelete'] = true; //删除订单
  39 + }
35 $statusInfo = self::getOrderStatus($orderV['is_cancel'], $orderV['status'], $orderV['payment_type'], $orderV['payment_status']); 40 $statusInfo = self::getOrderStatus($orderV['is_cancel'], $orderV['status'], $orderV['payment_type'], $orderV['payment_status']);
36 //订单状态 41 //订单状态
37 if ($statusInfo['cancel']) { 42 if ($statusInfo['cancel']) {
@@ -220,4 +220,55 @@ class OrdersController extends WebAction @@ -220,4 +220,55 @@ class OrdersController extends WebAction
220 $this->echoJson($data); 220 $this->echoJson($data);
221 } 221 }
222 222
  223 + /**
  224 + * 还原订单
  225 + */
  226 + public function restoreOrderAction()
  227 + {
  228 + $data = array('code' => 400, 'message' => '', 'data' => '');
  229 +
  230 + do {
  231 + /* 判断是不是AJAX请求 */
  232 + if (!$this->isAjax()) {
  233 + break;
  234 + }
  235 + $uid = $this->auditJumpLogin();
  236 + $orderCode = trim($this->post('orderCode', ''));
  237 +// $data = OrderData::confirmUserOrder($uid, $orderCode);
  238 + $data = array('code' => 400, 'message' => '订单还原成功', 'data' => '');
  239 + if (!isset($data['code'])) {
  240 + break;
  241 + }
  242 + }
  243 + while (false);
  244 +
  245 + $this->echoJson($data);
  246 + }
  247 +
  248 + /**
  249 + * 删除订单
  250 + */
  251 + public function deleteOrderAction()
  252 + {
  253 + $data = array('code' => 400, 'message' => '', 'data' => '');
  254 +
  255 + do {
  256 + /* 判断是不是AJAX请求 */
  257 + if (!$this->isAjax()) {
  258 + break;
  259 + }
  260 + $uid = $this->auditJumpLogin();
  261 + $orderCode = trim($this->post('orderCode', ''));
  262 +// $data = OrderData::confirmUserOrder($uid, $orderCode);
  263 + $data = array('code' => 400, 'message' => '订单删除成功', 'data' => '');
  264 + if (!isset($data['code'])) {
  265 + break;
  266 + }
  267 + }
  268 + while (false);
  269 +
  270 + $this->echoJson($data);
  271 + }
  272 +
  273 +
223 } 274 }