初始上传
This commit is contained in:
128
addon/cashier/shop/controller/Index.php
Executable file
128
addon/cashier/shop/controller/Index.php
Executable file
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\cashier\shop\controller;
|
||||
|
||||
use addon\cashier\model\Cashier;
|
||||
use app\model\store\Store;
|
||||
use app\model\system\Api;
|
||||
use app\shop\controller\BaseShop;
|
||||
use app\model\system\User;
|
||||
|
||||
/**
|
||||
* Class Index
|
||||
* @package addon\cashier\shop\controller
|
||||
*/
|
||||
class Index extends BaseShop
|
||||
{
|
||||
public function cashier()
|
||||
{
|
||||
$store_id = input('store_id', 0);
|
||||
|
||||
$user_model = new User();
|
||||
$user_info = $user_model->getUserInfo([['uid', '=', $this->user_info[ 'uid' ]]], 'uid,app_module,site_id,group_id,group_name,username,status,is_admin,password')[ 'data' ];
|
||||
if ($user_info[ 'is_admin' ]) {
|
||||
$store_info = (new Store())->getDefaultStore($user_info[ 'site_id' ])[ 'data' ] ?? [];
|
||||
if (empty($user_info[ 'user_group_list' ])) {
|
||||
$user_info[ 'user_group_list' ] = [$store_info];
|
||||
} else {
|
||||
$store_list = array_column($user_info[ 'user_group_list' ], null, 'store_id');
|
||||
if (!isset($store_list[ $store_info[ 'store_id' ] ])) $user_info[ 'user_group_list' ][] = $store_info;
|
||||
}
|
||||
}
|
||||
if (!$store_id && isset($user_info[ 'user_group_list' ][ 0 ])) $store_id = $user_info[ 'user_group_list' ][ 0 ][ 'store_id' ];
|
||||
$store_ids = array_column($user_info[ 'user_group_list' ], 'store_id');
|
||||
$token = $this->createToken($user_info, (86400 * 7));
|
||||
$this->assign('store_id', in_array($store_id, $store_ids) ? $store_id : 0);
|
||||
$this->assign('token', $token);
|
||||
$this->assign('root',__ROOT__);
|
||||
$this->assign('url', ROOT_URL . '/cashregister');
|
||||
return $this->fetch('index/cashier');
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建token
|
||||
* @param $user_info
|
||||
* @return string
|
||||
*/
|
||||
private function createToken($user_info)
|
||||
{
|
||||
$api_config = (new Api())->getApiConfig()[ 'data' ];
|
||||
$data = [
|
||||
'user_info' => $user_info,
|
||||
'expire_time' => $api_config[ 'value' ][ 'long_time' ] * 3600
|
||||
];
|
||||
|
||||
if ($api_config[ 'is_use' ] && isset($api_config[ 'value' ][ 'private_key' ]) && !empty($api_config[ 'value' ][ 'private_key' ])) {
|
||||
$token = encrypt(json_encode($data), $api_config[ 'value' ][ 'private_key' ]);
|
||||
} else {
|
||||
$token = encrypt(json_encode($data));
|
||||
}
|
||||
return $token;
|
||||
}
|
||||
|
||||
/**
|
||||
* 刷新收银端
|
||||
*/
|
||||
public function refreshCashier()
|
||||
{
|
||||
return (new Cashier())->refreshCashier();
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载收银端uniapp源码
|
||||
*/
|
||||
public function downloadCashier()
|
||||
{
|
||||
$res = (new Cashier())->downloadOs();
|
||||
echo $res[ 'message' ];
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置收银台主题风格配置
|
||||
*/
|
||||
public function setThemeConfig()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$cashier_model = new Cashier();
|
||||
$data = [
|
||||
'title' => input('title', ''),
|
||||
'name' => input('name', ''),
|
||||
'color' => input('color', '')
|
||||
];
|
||||
$res = $cashier_model->setThemeConfig($data, $this->site_id);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收银台主题风格配置
|
||||
*/
|
||||
public function getThemeConfig()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$cashier_model = new Cashier();
|
||||
$res = $cashier_model->getThemeConfig($this->site_id);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取收银台主题风格列表
|
||||
*/
|
||||
public function getThemeList()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$cashier_model = new Cashier();
|
||||
$res = $cashier_model->getThemeList();
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
245
addon/cashier/shop/controller/Order.php
Executable file
245
addon/cashier/shop/controller/Order.php
Executable file
@@ -0,0 +1,245 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\cashier\shop\controller;
|
||||
|
||||
use addon\cashier\model\order\CashierOrder as OrderModel;
|
||||
use app\dict\order_refund\OrderRefundDict;
|
||||
use app\model\order\Config as ConfigModel;
|
||||
use app\model\order\OrderCommon as OrderCommonModel;
|
||||
use app\model\store\Store;
|
||||
use app\model\web\Config as WebConfig;
|
||||
use app\shop\controller\BaseShop;
|
||||
use think\App;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 订单
|
||||
* Class Order
|
||||
* @package addon\cashier\shop\controller
|
||||
*/
|
||||
class Order extends BaseShop
|
||||
{
|
||||
|
||||
public function __construct(App $app = null)
|
||||
{
|
||||
$this->replace = [
|
||||
'CASHIER_CSS' => __ROOT__ . '/addon/cashier/shop/view/public/css',
|
||||
'CASHIER_JS' => __ROOT__ . '/addon/cashier/shop/view/public/js',
|
||||
'CASHIER_IMG' => __ROOT__ . '/addon/cashier/shop/view/public/img',
|
||||
];
|
||||
parent::__construct($app);
|
||||
}
|
||||
|
||||
/**
|
||||
*订单列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$order_label_list = [
|
||||
'order_no' => '订单号',
|
||||
'out_trade_no' => '交易流水号',
|
||||
'remark' => '订单备注',
|
||||
'name' => '收货人姓名',
|
||||
'order_name' => '商品名称',
|
||||
'mobile' => '收货人电话',
|
||||
'nick_name' => '会员昵称',
|
||||
'sku_no' => '商品编码',
|
||||
];
|
||||
|
||||
$order_model = new OrderModel();
|
||||
$order_status = input('order_status', '');//订单状态
|
||||
$order_name = input('order_name', '');
|
||||
$pay_type = input('pay_type', '');
|
||||
$order_from = input('order_from', '');
|
||||
$start_time = input('start_time', '');
|
||||
$end_time = input('end_time', '');
|
||||
$delivery_start_time = input('delivery_start_time', '');
|
||||
$delivery_end_time = input('delivery_end_time', '');
|
||||
$order_label = !empty($order_label_list[input('order_label')]) ? input('order_label') : '';
|
||||
$search_text = input('search', '');
|
||||
$promotion_type = input('promotion_type', '');//订单类型
|
||||
$order_type = input('order_type', 'all');//营销类型
|
||||
$is_verify = input('is_verify', 'all');
|
||||
$cashier_order_type = input('cashier_order_type', 'all');
|
||||
$store_id = input('store_id', '');
|
||||
|
||||
$cashier_order_type_list = $order_model->cashier_order_type;
|
||||
$order_common_model = new OrderCommonModel();
|
||||
if (request()->isJson()) {
|
||||
$page_index = input('page', 1);
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
$condition = [
|
||||
['a.site_id', '=', $this->site_id],
|
||||
['a.is_delete', '=', 0],
|
||||
['a.order_scene', '=', 'cashier'],
|
||||
// [ 'a.pay_status', '=', 1 ]
|
||||
];
|
||||
//订单状态
|
||||
if ($order_status != '') {
|
||||
if ($order_status == 'refunding') {
|
||||
$order_goods_list = $order_common_model->getOrderGoodsList([['refund_status', 'not in', [OrderRefundDict::REFUND_NOT_APPLY, OrderRefundDict::REFUND_COMPLETE]]], 'order_id')['data'];
|
||||
$order_id_arr = array_unique(array_column($order_goods_list, 'order_id'));
|
||||
$condition[] = ['a.order_id', 'in', $order_id_arr];
|
||||
} else {
|
||||
$condition[] = ['a.order_status', '=', $order_status];
|
||||
}
|
||||
}
|
||||
if ($is_verify != 'all') {
|
||||
$join[] = [
|
||||
'verify v',
|
||||
'v.verify_code = a.virtual_code',
|
||||
'left'
|
||||
];
|
||||
$condition[] = ['v.is_verify', '=', $is_verify];
|
||||
}
|
||||
|
||||
if ($store_id != '') {
|
||||
$condition[] = ['a.store_id', '=', $store_id];
|
||||
}
|
||||
//订单内容 模糊查询
|
||||
if ($order_name != '') {
|
||||
$condition[] = ['a.order_name', 'like', '%' . $order_name . '%'];
|
||||
}
|
||||
//订单来源
|
||||
if ($order_from != '') {
|
||||
$condition[] = ['a.order_from', '=', $order_from];
|
||||
}
|
||||
//订单支付
|
||||
if ($pay_type != '') {
|
||||
$condition[] = ['a.pay_type', '=', $pay_type];
|
||||
}
|
||||
//订单类型
|
||||
if ($order_type != 'all') {
|
||||
$condition[] = ['a.order_type', '=', $order_type];
|
||||
}
|
||||
|
||||
if ($cashier_order_type != 'all') {
|
||||
$condition[] = ['a.cashier_order_type', '=', $cashier_order_type];
|
||||
}
|
||||
//营销类型
|
||||
if ($promotion_type != '') {
|
||||
if ($promotion_type == 'empty') {
|
||||
$condition[] = ['a.promotion_type', '=', ''];
|
||||
} else {
|
||||
$condition[] = ['a.promotion_type', '=', $promotion_type];
|
||||
}
|
||||
}
|
||||
if (!empty($start_time) && empty($end_time)) {
|
||||
$condition[] = ['a.create_time', '>=', date_to_time($start_time)];
|
||||
} elseif (empty($start_time) && !empty($end_time)) {
|
||||
$condition[] = ['a.create_time', '<=', date_to_time($end_time)];
|
||||
} elseif (!empty($start_time) && !empty($end_time)) {
|
||||
$condition[] = ['a.create_time', 'between', [date_to_time($start_time), date_to_time($end_time)]];
|
||||
}
|
||||
|
||||
if (!empty($delivery_start_time) && empty($delivery_end_time)) {
|
||||
$condition[] = ['a.delivery_end_time', '>=', date_to_time($delivery_start_time)];
|
||||
} elseif (empty($delivery_start_time) && !empty($delivery_end_time)) {
|
||||
$condition[] = ['a.delivery_start_time', '<=', date_to_time($delivery_end_time)];
|
||||
} elseif (!empty($delivery_start_time) && !empty($delivery_end_time)) {
|
||||
$condition[] = [ '', 'exp', Db::raw("NOT(a.delivery_start_time > ".date_to_time($delivery_end_time)." or a.delivery_end_time < ".date_to_time($delivery_start_time).")") ];
|
||||
}
|
||||
|
||||
if ($search_text != '') {
|
||||
switch ($order_label) {
|
||||
case 'nick_name':
|
||||
$join[] = [
|
||||
'member m',
|
||||
'm.member_id = a.member_id',
|
||||
'left'
|
||||
];
|
||||
$condition[] = ['m.nickname', 'like', '%' . $search_text . '%'];
|
||||
break;
|
||||
case 'sku_no':
|
||||
$order_goods_list = $order_common_model->getOrderGoodsList([['sku_no', 'like', '%' . $search_text . '%']], 'order_id')['data'];
|
||||
$order_id_arr = array_unique(array_column($order_goods_list, 'order_id'));
|
||||
$condition[] = ['a.order_id', 'in', $order_id_arr];
|
||||
break;
|
||||
default:
|
||||
$condition[] = ['a.' . $order_label, 'like', '%' . $search_text . '%'];
|
||||
}
|
||||
}
|
||||
|
||||
$field = 'a.*,s.store_name';
|
||||
$order = 'a.create_time desc';
|
||||
$alias = 'a';
|
||||
$join[] = [
|
||||
'store s',
|
||||
's.store_id = a.store_id',
|
||||
'left'
|
||||
];
|
||||
$list = $order_common_model->getOrderPageList($condition, $page_index, $page_size, $order, $field, $alias, $join);
|
||||
if (!empty($list['data']['list'])) {
|
||||
foreach ($list['data']['list'] as $k => $v) {
|
||||
$list['data']['list'][$k]['cashier_order_type_name'] = $cashier_order_type_list[$v['cashier_order_type']];
|
||||
}
|
||||
}
|
||||
$list['data']['order_status'] = $order_status;
|
||||
|
||||
$total_pay_money = $order_common_model->getOrderSum($condition, 'a.pay_money', $alias, $join)['data'];
|
||||
$list['data']['total_pay_money'] = $total_pay_money;
|
||||
|
||||
return $list;
|
||||
} else {
|
||||
|
||||
$order_type_list = $order_common_model->getOrderTypeStatusList();
|
||||
$this->assign('order_type_list', $order_type_list);
|
||||
$this->assign('order_label_list', $order_label_list);
|
||||
|
||||
$this->assign('order_status_list', $order_type_list[1]['status']);//订单状态
|
||||
//订单来源 (支持端口)
|
||||
$this->assign('order_from_list', $order_common_model->getOrderFromList());
|
||||
|
||||
$pay_type = $order_common_model->getPayType(['order_type' => 5]);
|
||||
$this->assign('pay_type_list', $pay_type);
|
||||
|
||||
$this->assign('order_status', $order_status);
|
||||
$this->assign('cashier_order_type_list', $cashier_order_type_list);
|
||||
$this->assign('http_type', get_http_type());
|
||||
|
||||
$config_model = new ConfigModel();
|
||||
$order_config = $config_model->getOrderEventTimeConfig($this->site_id, $this->app_module)['data']['value'] ?? [];
|
||||
$this->assign('order_config', $order_config);
|
||||
|
||||
$config_model = new WebConfig();
|
||||
$mp_config = $config_model->getMapConfig($this->site_id);
|
||||
$this->assign('tencent_map_key', $mp_config['data']['value']['tencent_map_key']);
|
||||
|
||||
$store_list = (new Store())->getStoreList([['site_id', '=', $this->site_id]], 'store_name,store_id')['data'];
|
||||
$this->assign('store_list', $store_list);
|
||||
|
||||
return $this->fetch('order/lists');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 快递订单详情
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$order_id = input('order_id', 0);
|
||||
$order_common_model = new OrderCommonModel();
|
||||
$order_detail = $order_common_model->getOrderDetail($order_id)['data'];
|
||||
|
||||
if (empty($order_detail)) $this->error('未获取到订单数据', href_url('shop/order/lists'));
|
||||
|
||||
$this->assign('order_detail', $order_detail);
|
||||
|
||||
$this->assign('http_type', get_http_type());
|
||||
|
||||
$config_model = new WebConfig();
|
||||
$mp_config = $config_model->getMapConfig($this->site_id);
|
||||
$this->assign('tencent_map_key', $mp_config['data']['value']['tencent_map_key']);
|
||||
|
||||
return $this->fetch('order/detail');
|
||||
}
|
||||
}
|
||||
204
addon/cashier/shop/controller/User.php
Executable file
204
addon/cashier/shop/controller/User.php
Executable file
@@ -0,0 +1,204 @@
|
||||
<?php
|
||||
/**
|
||||
* Niushop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 杭州牛之云科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.niushop.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\cashier\shop\controller;
|
||||
|
||||
use addon\cashier\model\Group;
|
||||
use addon\cashier\model\Menu;
|
||||
use app\shop\controller\BaseShop;
|
||||
use think\facade\Db;
|
||||
use app\model\store\Store as StoreModel;
|
||||
|
||||
/**
|
||||
* Class User
|
||||
* @package app\shop\controller
|
||||
*/
|
||||
class User extends BaseShop
|
||||
{
|
||||
/**
|
||||
* 用户列表
|
||||
* @return mixed
|
||||
*/
|
||||
public function group()
|
||||
{
|
||||
$curr_user_info = $this->getUserInfo();
|
||||
if(empty($curr_user_info)){
|
||||
echo '用户信息有误';exit;
|
||||
}
|
||||
$curr_user_group_ids = array_column($curr_user_info['user_group_list'], 'group_id');
|
||||
if (request()->isJson()) {
|
||||
$page = input('page', 1);
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
$search_keys = input('search_keys', '');
|
||||
|
||||
$condition = [];
|
||||
if($curr_user_info['is_admin'] == 0){
|
||||
if(empty($curr_user_group_ids)) $curr_user_group_ids = [-1];
|
||||
$condition[] = ['', 'exp', Db::raw("group_id in (".join(',', $curr_user_group_ids).") or create_user_data like '%\"".$this->uid."\"%'")];
|
||||
}
|
||||
if (!empty($search_keys)) {
|
||||
$condition[] = [ 'group_name', 'like', '%' . $search_keys . '%' ];
|
||||
}
|
||||
$condition[] = [ '', 'exp', Db::raw("keyword = '' OR site_id = {$this->site_id}") ];
|
||||
|
||||
$group_model = new Group();
|
||||
return $group_model->getGroupPageList($condition, $page, $page_size, 'group_id desc', '*');
|
||||
} else {
|
||||
|
||||
$this->assign('curr_user_group_ids', $curr_user_info['is_admin'] == 0 ? $curr_user_group_ids : []);
|
||||
return $this->fetch('user/group_list');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加用户组
|
||||
* @return mixed
|
||||
*/
|
||||
public function addGroup()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$group_name = input('group_name', '');
|
||||
$menu_array = input('menu_array', '');
|
||||
$desc = input('desc', '');
|
||||
$store_id = input('store_id', 0);
|
||||
$store_name = input('store_name', '');
|
||||
$group_model = new Group();
|
||||
$data = [
|
||||
'group_name' => $group_name,
|
||||
'site_id' => $this->site_id,
|
||||
'menu_array' => $menu_array,
|
||||
'desc' => $desc,
|
||||
'create_time' => time(),
|
||||
'store_id' => $store_id,
|
||||
'store_name' => $store_name,
|
||||
'create_uid' => $this->uid,
|
||||
];
|
||||
return $group_model->addGroup($data);
|
||||
} else {
|
||||
$menu_model = new Menu();
|
||||
$menu_list = $menu_model->getMenuList([], '*');
|
||||
$menu_tree = list_to_tree($menu_list[ 'data' ], 'name', 'parent', 'child_list', '');
|
||||
$this->assign('tree_data', $menu_tree);
|
||||
|
||||
//可以选择的门店
|
||||
$curr_user_info = $this->getUserInfo();
|
||||
if($curr_user_info['create_uid'] == 0){
|
||||
$store_model = new StoreModel();
|
||||
$store_list = $store_model->getStoreList([], 'store_id,store_name', 'is_default desc,store_id desc')['data'];
|
||||
array_unshift($store_list, [
|
||||
'store_id' => 0,
|
||||
'store_name' => '全部门店',
|
||||
]);
|
||||
}else{
|
||||
$store_list = $curr_user_info['user_group_list'];
|
||||
foreach($store_list as &$store_info){
|
||||
if(!empty($store_info['menu_array'])){
|
||||
$menu_list = $menu_model->getMenuList([['name', 'in', $store_info['menu_array']]], '*');
|
||||
$store_info['tree_data'] = list_to_tree($menu_list[ 'data' ], 'name', 'parent', 'child_list', '');
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->assign('store_list', $store_list);
|
||||
|
||||
return $this->fetch('user/add_group');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑用户组
|
||||
* @return mixed
|
||||
*/
|
||||
public function editGroup()
|
||||
{
|
||||
$group_model = new Group();
|
||||
if (request()->isJson()) {
|
||||
$group_name = input('group_name', '');
|
||||
$menu_array = input('menu_array', '');
|
||||
$group_id = input('group_id', 0);
|
||||
$desc = input('desc', '');
|
||||
|
||||
$data = [
|
||||
'group_name' => $group_name,
|
||||
'menu_array' => $menu_array,
|
||||
'desc' => $desc,
|
||||
];
|
||||
$condition = [
|
||||
['group_id', '=', $group_id ],
|
||||
['site_id', '=', $this->site_id ],
|
||||
];
|
||||
return $group_model->editGroup($data, $condition);
|
||||
} else {
|
||||
$group_id = input('group_id', 0);
|
||||
$condition = [
|
||||
['group_id', '=', $group_id ],
|
||||
['site_id', '=', $this->site_id ],
|
||||
];
|
||||
$group_info_result = $group_model->getGroupInfo($condition);
|
||||
$group_info = $group_info_result['data'];
|
||||
if (empty($group_info)) $this->error('未获取到用户组数据', href_url('shop/user/group'));
|
||||
$this->assign('group_info', $group_info);
|
||||
$this->assign('group_id', $group_id);
|
||||
//获取菜单权限
|
||||
$menu_model = new Menu();
|
||||
$menu_list = $menu_model->getMenuList([], '*');
|
||||
|
||||
//编辑权限是可以显示的是创建者权限的合集
|
||||
$create_user_info = $this->getUserInfo($group_info['create_uid']);
|
||||
if( !empty($create_user_info) && $create_user_info['create_uid'] > 0){
|
||||
$store_list = $create_user_info['user_group_list'];
|
||||
$menu_array = '';
|
||||
foreach($store_list as $store_info){
|
||||
if($store_info['store_id'] == $group_info['store_id']){
|
||||
$menu_array = $store_info['menu_array'];
|
||||
}
|
||||
}
|
||||
if(!empty($menu_array)){
|
||||
$menu_array .= ','.$group_info['menu_array'];
|
||||
$menu_array = array_unique(explode(',', $menu_array));
|
||||
$menu_list = $menu_model->getMenuList([['name', 'in', $menu_array]], '*');
|
||||
}
|
||||
}
|
||||
//处理选中数据
|
||||
$menu_array = $group_info[ 'menu_array' ];
|
||||
$menu_array = explode(',', $menu_array);
|
||||
foreach ($menu_list[ 'data' ] as $key => $val) {
|
||||
if (in_array($val[ 'name' ], $menu_array)) {
|
||||
$menu_list[ 'data' ][ $key ][ 'checked' ] = true;
|
||||
} else {
|
||||
$menu_list[ 'data' ][ $key ][ 'checked' ] = false;
|
||||
}
|
||||
}
|
||||
$menu_tree = list_to_tree($menu_list[ 'data' ], 'name', 'parent', 'child_list', '');
|
||||
$this->assign('tree_data', $menu_tree);
|
||||
|
||||
//门店选择
|
||||
$store_model = new StoreModel();
|
||||
$store_list = $store_model->getStoreList([], 'store_id,store_name', 'is_default desc,store_id desc')['data'];
|
||||
$this->assign('store_list', $store_list);
|
||||
return $this->fetch('user/edit_group');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除用户组
|
||||
*/
|
||||
public function deleteGroup()
|
||||
{
|
||||
if (request()->isJson()) {
|
||||
$group_id = input('group_id', '');
|
||||
$condition = [
|
||||
['group_id', '=', $group_id ],
|
||||
['site_id', '=', $this->site_id ],
|
||||
];
|
||||
$group_model = new Group();
|
||||
return $group_model->deleteGroup($condition);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user