修复内容
This commit is contained in:
@@ -100,26 +100,42 @@ class Order extends AdminBase
|
||||
*/
|
||||
public function del()
|
||||
{
|
||||
|
||||
if ($this->request->isAjax()) {
|
||||
dump(123);die;
|
||||
// $post = $this->request->post('');
|
||||
// $order=Db::name('order')->where('id',$post['order_id'])->find();//查询订单信息
|
||||
|
||||
// if($this->admin_id!=6){
|
||||
// $this->_error('无权限删除');
|
||||
// }else{
|
||||
// $orderdel=Db::name('order_exe')->where('order_sn',$order['order_sn'])->find();
|
||||
// if($orderdel){
|
||||
// $this->_error('无法删除,存在主订单');
|
||||
// }else{
|
||||
// $del=Db::name('order')->where('id',$post['order_id'])->delete();
|
||||
// $this->_success('删除成功');
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
$id = $this->request->get('id');
|
||||
$order = Db::name('order')->find($id);//查询订单信息
|
||||
if ($order == null){
|
||||
$this->_error('订单不存在');
|
||||
}
|
||||
$del = Db::name('order')->where('id',$id)->update(['del' => 1]);
|
||||
if($del){
|
||||
$this->_success('删除成功');
|
||||
}else{
|
||||
$this->_error('删除失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* User: 恢复已删除订单
|
||||
* Desc: 将 del 从 1 恢复为 0
|
||||
*/
|
||||
public function recover()
|
||||
{
|
||||
if ($this->request->isAjax()) {
|
||||
$id = $this->request->get('id');
|
||||
$order = Db::name('order')->find($id);// 查询订单信息
|
||||
if ($order == null){
|
||||
$this->_error('订单不存在');
|
||||
}
|
||||
if ($order['del'] == 0) {
|
||||
$this->_error('订单未删除,无需恢复');
|
||||
}
|
||||
$res = Db::name('order')->where('id',$id)->update(['del' => 0]);
|
||||
if ($res) {
|
||||
$this->_success('恢复成功');
|
||||
} else {
|
||||
$this->_error('恢复失败');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +284,7 @@ class Order extends AdminBase
|
||||
$this->_success('修改订单成功', OrderLogic::edit($post));
|
||||
}
|
||||
|
||||
$this->assign('info', json_encode(OrderLogic::orderinfoid($id), JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('info', json_encode(OrderLogic::orderinfoid($id), JSON_UNESCAPED_UNICODE));
|
||||
$brand_lists=Db::name('orderchannel')->select();
|
||||
$this->assign('brand_lists', json_encode($brand_lists, JSON_UNESCAPED_UNICODE));
|
||||
$this->assign('category_lists', json_encode(StaffLogic::getAllTree(), JSON_UNESCAPED_UNICODE));
|
||||
|
||||
Reference in New Issue
Block a user