61 lines
1.7 KiB
PHP
61 lines
1.7 KiB
PHP
<?php
|
|
namespace app\admin\controller;
|
|
use app\admin\logic\OrderchanelLogic;
|
|
use app\common\server\ConfigServer;
|
|
use think\Db;
|
|
class Orderchanel extends AdminBase {
|
|
|
|
/**
|
|
* order: 哆啦猫订单渠道
|
|
* Desc: 订单列表
|
|
*/
|
|
public function ordertypelist(){
|
|
$lists = json_encode(OrderchanelLogic::ordertypelist());
|
|
$this->assign('lists', $lists);
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* order: 哆啦猫订单渠道
|
|
* Desc: 增加渠道
|
|
*/
|
|
public function ordertypeadd(){
|
|
if ($this->request->isAjax()) {
|
|
$post = $this->request->post();
|
|
$lists = OrderchanelLogic::ordertypeadd($post);
|
|
$this->_success('增加渠道成功');
|
|
}
|
|
$this->assign('menu_lists', OrderchanelLogic::Menu());
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* order: 哆啦猫订单渠道
|
|
* Desc: 修改渠道名称
|
|
*/
|
|
public function ordertypeedit($id){
|
|
if ($this->request->isAjax()) {
|
|
$post = $this->request->post();
|
|
$lists = OrderchanelLogic::ordertypeedit($post);
|
|
$this->_success('修改订单渠道成功');
|
|
}
|
|
$this->assign('info', OrderchanelLogic::info($id));
|
|
$this->assign('menu_lists', OrderchanelLogic::Menu($id));
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* order: 哆啦猫订单渠道
|
|
* Desc: 删除渠道
|
|
*/
|
|
public function ordertypedel($id){
|
|
$del=Db::name('orderchannel')->where('pid',$id)->find();
|
|
if($del){
|
|
$this->_error('请先删除下级分类');
|
|
}else{
|
|
$del=Db::name('orderchannel')->where('id',$id)->delete();
|
|
$this->_success('删除成功');
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|