Merge branch 'master' of http://111.229.174.37:3000/Food/food_server
This commit is contained in:
commit
954c332a00
@ -542,33 +542,38 @@ class PlaneController extends PublicController
|
|||||||
echo json_encode(array('status' => 1, 'msg' => '访问成功', "questList" => $questList));
|
echo json_encode(array('status' => 1, 'msg' => '访问成功', "questList" => $questList));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @description: 改变订单 quest字段 改变为接单状态
|
* @description: 改变订单状态或退款字段 不处理 已取消 未付款 交易关闭的订单
|
||||||
*/
|
*/
|
||||||
public function questAss()
|
public function questAss()
|
||||||
{
|
{
|
||||||
if ($this->tokenShop_id != C('powerId')) { //非总管理员
|
if ($this->tokenShop_id != C('powerId')) { //非总管理员
|
||||||
$where['shop_id'] = $this->tokenShop_id;
|
$where['shop_id'] = $this->tokenShop_id;
|
||||||
}
|
}
|
||||||
|
//前端提交数据校验
|
||||||
if ($_REQUEST['id'] && $_REQUEST['state'] && $_REQUEST['val']) {
|
if ($_REQUEST['id'] && $_REQUEST['state'] && $_REQUEST['val']) {
|
||||||
$where['id'] = $_REQUEST['id'];
|
$where['id'] = $_REQUEST['id'];
|
||||||
$orderDb = D('order');
|
$orderDb = D('order');
|
||||||
|
$field = array('status');
|
||||||
|
$order = $orderDb->where($where)->field($field)->find();
|
||||||
|
//不处理订单状态处于 已取消 未付款 交易关闭的情况
|
||||||
|
if ($order['status'] == 'canceled' || $order['status'] == 'unpaid' || $order['status'] == 'closed') {
|
||||||
|
echo json_encode(array('status' => 0, 'msg' => '参数有误'));
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo json_encode(array('status' => 0, 'msg' => '参数有误'));
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
//操作数据库
|
||||||
if ($_REQUEST['state'] == 'status') {
|
if ($_REQUEST['state'] == 'status') {
|
||||||
$data['status'] = $_REQUEST['val']; //改变订单状态
|
$data['status'] = $_REQUEST['val']; //改变订单状态
|
||||||
} elseif ($_REQUEST['state'] == 'back') {
|
} elseif ($_REQUEST['state'] == 'back') {
|
||||||
if ($_REQUEST['val'] == 'zero') {
|
$data['back'] = $_REQUEST['val']; //改变订单状态
|
||||||
$data['back'] = '0'; //改变退货状态
|
|
||||||
} else {
|
|
||||||
$data['back'] = '1'; //改变退货状态
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if ($orderDb->where($where)->save($data)) {
|
if ($orderDb->where($where)->save($data)) {
|
||||||
echo json_encode(array('status' => 1, 'msg' => '订单修改成功'));
|
echo json_encode(array('status' => 1, 'msg' => '订单修改成功'));
|
||||||
} else {
|
} else {
|
||||||
echo json_encode(array('status' => 0, 'msg' => '订单修改失败'));
|
echo json_encode(array('status' => 0, 'msg' => '订单修改失败'));
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
echo json_encode(array('status' => 0, 'msg' => '参数有误'));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user