管理员列表优化
parent
8b5b2228b2
commit
400ad10a71
|
|
@ -50,48 +50,31 @@ class Admin extends Common
|
|||
// 权限校验
|
||||
$this->IsPower();
|
||||
|
||||
// 参数
|
||||
$params = input();
|
||||
|
||||
// 条件
|
||||
$where = AdminService::AdminListWhere($params);
|
||||
|
||||
// 总数
|
||||
$total = AdminService::AdminTotal($where);
|
||||
$total = AdminService::AdminTotal($this->form_where);
|
||||
|
||||
// 分页
|
||||
$number = MyC('admin_page_number', 10, true);
|
||||
$page_params = array(
|
||||
'number' => $number,
|
||||
'total' => $total,
|
||||
'where' => $params,
|
||||
'page' => isset($params['page']) ? intval($params['page']) : 1,
|
||||
'url' => MyUrl('admin/admin/index'),
|
||||
);
|
||||
$page_params = [
|
||||
'number' => $this->page_size,
|
||||
'total' => $total,
|
||||
'where' => $this->data_request,
|
||||
'page' => $this->page,
|
||||
'url' => MyUrl('admin/admin/index'),
|
||||
];
|
||||
$page = new \base\Page($page_params);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
|
||||
// 获取管理员列表
|
||||
// 获取数据列表
|
||||
$data_params = [
|
||||
'where' => $where,
|
||||
'm' => $page->GetPageStarNumber(),
|
||||
'n' => $number,
|
||||
];
|
||||
$data = AdminService::AdminList($data_params);
|
||||
$this->assign('data_list', $data['data']);
|
||||
|
||||
// 角色
|
||||
$role_params = [
|
||||
'where' => ['is_enable'=>1],
|
||||
'field' => 'id,name',
|
||||
];
|
||||
$role = AdminService::RoleList($role_params);
|
||||
$this->assign('role_list', $role['data']);
|
||||
'where' => $this->form_where,
|
||||
'm' => $page->GetPageStarNumber(),
|
||||
'n' => $this->page_size,
|
||||
];
|
||||
$ret = AdminService::AdminList($data_params);
|
||||
|
||||
// 性别
|
||||
$this->assign('common_gender_list', lang('common_gender_list'));
|
||||
|
||||
$this->assign('params', $params);
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
return $this->fetch();
|
||||
}
|
||||
|
||||
|
|
@ -108,7 +91,7 @@ class Admin extends Common
|
|||
$this->IsLogin();
|
||||
|
||||
// 参数
|
||||
$params = input();
|
||||
$params = $this->data_request;
|
||||
|
||||
// 不是操作自己的情况下
|
||||
if(!isset($params['id']) || $params['id'] != $this->admin['id'])
|
||||
|
|
@ -144,6 +127,7 @@ class Admin extends Common
|
|||
|
||||
$this->assign('id', isset($params['id']) ? $params['id'] : 0);
|
||||
$this->assign('common_gender_list', lang('common_gender_list'));
|
||||
$this->assign('common_admin_status_list', lang('common_admin_status_list'));
|
||||
|
||||
// 管理员编辑页面钩子
|
||||
$hook_name = 'plugins_view_admin_admin_save';
|
||||
|
|
@ -181,7 +165,7 @@ class Admin extends Common
|
|||
$this->IsLogin();
|
||||
|
||||
// 参数
|
||||
$params = input('post.');
|
||||
$params = $this->data_post;
|
||||
|
||||
// 不是操作自己的情况下
|
||||
if(!isset($params['id']) || $params['id'] != $this->admin['id'])
|
||||
|
|
@ -217,7 +201,7 @@ class Admin extends Common
|
|||
$this->IsPower();
|
||||
|
||||
// 开始操作
|
||||
$params = input('post.');
|
||||
$params = $this->data_post;
|
||||
$params['admin'] = $this->admin;
|
||||
return AdminService::AdminDelete($params);
|
||||
}
|
||||
|
|
@ -264,7 +248,7 @@ class Admin extends Common
|
|||
}
|
||||
|
||||
// 开始操作
|
||||
$params = input('post.');
|
||||
$params = $this->data_post;
|
||||
return AdminService::Login($params);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ class Goods extends Common
|
|||
];
|
||||
$ret = GoodsService::GoodsList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
|
|
|
|||
|
|
@ -71,6 +71,7 @@ class Goodscomments extends Common
|
|||
];
|
||||
$ret = GoodsCommentsService::GoodsCommentsList($data_params);
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class Order extends Common
|
|||
];
|
||||
$this->assign('buy_payment_list', PaymentService::BuyPaymentList($pay_where));
|
||||
|
||||
// 参数
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class Orderaftersale extends Common
|
|||
// 静态数据
|
||||
$this->assign('common_order_aftersale_refundment_list', lang('common_order_aftersale_refundment_list'));
|
||||
|
||||
// 参数
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ class User extends Common
|
|||
// Excel地址
|
||||
$this->assign('excel_url', MyUrl('admin/user/excelexport', $this->data_request));
|
||||
|
||||
// 基础参数赋值
|
||||
$this->assign('params', $this->data_request);
|
||||
$this->assign('page_html', $page->GetPageHtml());
|
||||
$this->assign('data_list', $ret['data']);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,185 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | ShopXO 国内领先企业级B2C免费开源电商系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2011~2019 http://shopxo.net All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Devil
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\admin\form;
|
||||
|
||||
use app\service\AdminService;
|
||||
|
||||
/**
|
||||
* 管理员动态表格
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-06-11
|
||||
* @desc description
|
||||
*/
|
||||
class Admin
|
||||
{
|
||||
// 基础条件
|
||||
public $condition_base = [];
|
||||
|
||||
/**
|
||||
* 入口
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-06-11
|
||||
* @desc description
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public function Run($params = [])
|
||||
{
|
||||
return [
|
||||
// 基础配置
|
||||
'base' => [
|
||||
'key_field' => 'id',
|
||||
'status_field' => 'status',
|
||||
'is_search' => 1,
|
||||
'search_url' => MyUrl('admin/admin/index'),
|
||||
'is_delete' => 1,
|
||||
'delete_url' => MyUrl('admin/admin/delete'),
|
||||
'delete_key' => 'ids',
|
||||
],
|
||||
// 表单配置
|
||||
'form' => [
|
||||
[
|
||||
'view_type' => 'checkbox',
|
||||
'is_checked' => 0,
|
||||
'checked_text' => '反选',
|
||||
'not_checked_text' => '全选',
|
||||
'align' => 'center',
|
||||
'width' => 80,
|
||||
'is_not_show' => 1,
|
||||
'not_data' => [1],
|
||||
'not_key' => 'id',
|
||||
],
|
||||
[
|
||||
'label' => '管理员',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'username',
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'where_type' => 'like',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '状态',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'status_text',
|
||||
'search_config' => [
|
||||
'form_type' => 'select',
|
||||
'form_name' => 'status',
|
||||
'where_type' => 'in',
|
||||
'data' => lang('common_admin_status_list'),
|
||||
'data_key' => 'value',
|
||||
'data_name' => 'name',
|
||||
'is_multiple' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '性别',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'gender_text',
|
||||
'search_config' => [
|
||||
'form_type' => 'select',
|
||||
'form_name' => 'gender',
|
||||
'where_type' => 'in',
|
||||
'data' => lang('common_gender_list'),
|
||||
'data_key' => 'id',
|
||||
'data_name' => 'name',
|
||||
'is_multiple' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '手机',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'mobile',
|
||||
'search_config' => [
|
||||
'form_type' => 'input',
|
||||
'where_type' => 'like',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '角色组',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'role_name',
|
||||
'search_config' => [
|
||||
'form_type' => 'select',
|
||||
'form_name' => 'role_id',
|
||||
'where_type' => 'in',
|
||||
'data' => $this->GetRoleList(),
|
||||
'data_key' => 'id',
|
||||
'data_name' => 'name',
|
||||
'is_multiple' => 1,
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '登录次数',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'login_total',
|
||||
'search_config' => [
|
||||
'form_type' => 'section',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '最后登录时间',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'login_time',
|
||||
'search_config' => [
|
||||
'form_type' => 'datetime',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '创建时间',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'add_time',
|
||||
'search_config' => [
|
||||
'form_type' => 'datetime',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '更新时间',
|
||||
'view_type' => 'field',
|
||||
'view_key' => 'upd_time',
|
||||
'search_config' => [
|
||||
'form_type' => 'datetime',
|
||||
],
|
||||
],
|
||||
[
|
||||
'label' => '操作',
|
||||
'view_type' => 'operate',
|
||||
'view_key' => 'admin/module/operate',
|
||||
'align' => 'center',
|
||||
'fixed' => 'right',
|
||||
],
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取角色组列表
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-06-11
|
||||
* @desc description
|
||||
*/
|
||||
public function GetRoleList()
|
||||
{
|
||||
// 角色
|
||||
$params = [
|
||||
'where' => ['is_enable'=>1],
|
||||
'field' => 'id,name',
|
||||
];
|
||||
$res = AdminService::RoleList($params);
|
||||
return $res['data'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
@ -1,146 +1,9 @@
|
|||
{{include file="public/header" /}}
|
||||
<!-- 继承公共的 form -->
|
||||
{{extend name="public/module/form" /}}
|
||||
|
||||
<!-- right content start -->
|
||||
<div class="content-right">
|
||||
<div class="content">
|
||||
<!-- form start -->
|
||||
<form class="am-form form-validation form-search" method="post" action="{{:MyUrl('admin/admin/index')}}" request-type="form">
|
||||
<div class="thin">
|
||||
<div class="am-input-group am-input-group-sm am-fl so">
|
||||
<input type="text" autocomplete="off" name="keywords" class="am-radius" placeholder="用户名/手机" value="{{if !empty($params.keywords)}}{{$params.keywords}}{{/if}}" />
|
||||
<span class="am-input-group-btn">
|
||||
<button class="am-btn am-btn-default am-radius" type="submit" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
|
||||
</span>
|
||||
</div>
|
||||
<label class="am-fl thin_sub more-submit">
|
||||
更多筛选条件
|
||||
{{if isset($params['is_more']) and $params['is_more'] eq 1}}
|
||||
<input type="checkbox" name="is_more" value="1" id="is_more" checked />
|
||||
<i class="am-icon-angle-up"></i>
|
||||
{{else /}}
|
||||
<input type="checkbox" name="is_more" value="1" id="is_more" />
|
||||
<i class="am-icon-angle-down"></i>
|
||||
{{/if}}
|
||||
</label>
|
||||
</div>
|
||||
<table class="so-list more-where {{if !isset($params['is_more'])}}none{{/if}}">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>
|
||||
<span>权限:</span>
|
||||
<select name="role_id" class="chosen-select" data-placeholder="权限组...">
|
||||
<option value="-1">权限组...</option>
|
||||
{{foreach $role_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($params['role_id']) and $params['role_id'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<span>性别:</span>
|
||||
<select name="gender" class="chosen-select" data-placeholder="性别...">
|
||||
<option value="-1">性别...</option>
|
||||
{{foreach $common_gender_list as $v}}
|
||||
<option value="{{$v.id}}" {{if isset($params['gender']) and $params['gender'] eq $v['id']}}selected{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</td>
|
||||
<tr>
|
||||
<td class="time">
|
||||
<span>时间:</span>
|
||||
<span>
|
||||
<input type="text" autocomplete="off" name="time_start" class="am-form-field am-input-sm am-radius Wdate" placeholder="起始时间" value="{{if !empty($params.time_start)}}{{$params.time_start}}{{/if}}" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
|
||||
</span>
|
||||
<em class="text-grey">~</em>
|
||||
<span>
|
||||
<input type="text" autocomplete="off" name="time_end" class="am-form-field am-input-sm am-radius Wdate" placeholder="结束时间" value="{{if !empty($params.time_end)}}{{$params.time_end}}{{/if}}" pattern="^[0-9]{4}-[0-9]{2}-[0-9]{2}$" data-validation-message="日期格式有误" onclick="WdatePicker({firstDayOfWeek:1,dateFmt:'yyyy-MM-dd'})" autocomplete="off" /><i class="am-icon-calendar"></i>
|
||||
</span>
|
||||
</td>
|
||||
<td>
|
||||
<button type="submit" class="am-btn am-btn-primary am-radius am-btn-xs btn-loading-example" data-am-loading="{spinner:'circle-o-notch', loadingText:'搜索中...'}">搜索</button>
|
||||
<a href="{{:MyUrl('admin/admin/index')}}" class="am-btn am-btn-warning am-radius am-btn-sm reset-submit">清除条件</a>
|
||||
</td>
|
||||
</tr>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
<!-- form end -->
|
||||
|
||||
|
||||
<!-- operation start -->
|
||||
<div class="am-g am-margin-top-sm">
|
||||
<a href="{{:MyUrl('admin/admin/saveinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
|
||||
</div>
|
||||
<!-- operation end -->
|
||||
|
||||
<!-- list start -->
|
||||
<div class="am-scrollable-horizontal am-table-scrollable-horizontal am-margin-top-sm">
|
||||
<table class="am-table am-table-striped am-table-hover am-table-bordered am-text-nowrap am-table-td-fixed-last">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>管理员</th>
|
||||
<th>性别</th>
|
||||
<th>登录次数</th>
|
||||
<th>手机号码</th>
|
||||
<th>权限组</th>
|
||||
<th>最后登录时间</th>
|
||||
<th>创建时间</th>
|
||||
<th class="am-text-center" data-width="170">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{if !empty($data_list)}}
|
||||
{{foreach $data_list as $v}}
|
||||
<tr id="data-list-{{$v.id}}">
|
||||
<td>{{$v.username}}</td>
|
||||
<td class="am-text-middle">{{:lang('common_gender_list')[$v['gender']]['name']}}</td>
|
||||
<td class="am-text-middle">{{$v.login_total}}</td>
|
||||
<td class="am-text-middle">{{if empty($v['mobile'])}}<span class="cr-ddd">未填写</span>{{else /}}{{$v.mobile}}{{/if}}</td>
|
||||
<td class="am-text-middle">{{$v.role_name}}</td>
|
||||
<td class="am-text-middle">
|
||||
{{if $v['login_total'] eq 0}}
|
||||
未登录
|
||||
{{else /}}
|
||||
{{:date('Y-m-d H:i:s', $v['login_time'])}}
|
||||
{{/if}}
|
||||
</td>
|
||||
<td class="am-text-middle">{{:date('Y-m-d H:i:s', $v['add_time'])}}</td>
|
||||
<td class="am-operate-grid" data-width="170">
|
||||
<div class="am-scrollable-vertical">
|
||||
{{if $v['id'] eq 1}}
|
||||
<span class="cr-ccc">不可操作</span>
|
||||
{{else /}}
|
||||
<a class="am-btn am-btn-secondary am-btn-xs am-radius" href="{{:MyUrl('admin/admin/saveinfo', array('id'=>$v['id']))}}">
|
||||
<i class="am-icon-edit"></i>
|
||||
<span>编辑</span>
|
||||
</a>
|
||||
{{if $v['id'] neq $admin['id']}}
|
||||
<button class="am-btn am-btn-danger am-btn-xs am-radius submit-delete" data-url="{{:MyUrl('admin/admin/delete')}}" data-id="{{$v.id}}">
|
||||
<i class="am-icon-trash-o"></i>
|
||||
<span>删除</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</tbody>
|
||||
</table>
|
||||
{{if empty($data_list)}}
|
||||
<div class="table-no"><i class="am-icon-warning"></i> 没有相关数据</div>
|
||||
{{/if}}
|
||||
</div>
|
||||
<!-- list end -->
|
||||
|
||||
<!-- page start -->
|
||||
{{if !empty($data_list)}}
|
||||
{{$page_html|raw}}
|
||||
{{/if}}
|
||||
<!-- page end -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- right content end -->
|
||||
|
||||
{{include file="public/footer" /}}
|
||||
<!-- 表单顶部操作栏 -->
|
||||
{{block name="form_operate_top"}}
|
||||
<a href="{{:MyUrl('admin/admin/saveinfo')}}" class="am-btn am-btn-secondary am-radius am-btn-xs am-icon-plus"> 新增</a>
|
||||
<!-- 父级内容 -->
|
||||
{__block__}
|
||||
{{/block}}
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<!-- 操作栏 -->
|
||||
{{if $module_data['id'] eq 1}}
|
||||
<span class="cr-ccc">不可操作</span>
|
||||
{{else /}}
|
||||
<a class="am-btn am-btn-secondary am-btn-xs am-radius am-btn-block" href="{{:MyUrl('admin/admin/saveinfo', array('id'=>$module_data['id']))}}">
|
||||
<i class="am-icon-edit"></i>
|
||||
<span>编辑</span>
|
||||
</a>
|
||||
{{if $module_data['id'] neq $admin['id']}}
|
||||
<button type="button" class="am-btn am-btn-danger am-btn-xs am-radius am-btn-block submit-delete" data-url="{{:MyUrl('admin/admin/delete')}}" data-id="{{$module_data.id}}" data-key="ids">
|
||||
<i class="am-icon-trash-o"></i>
|
||||
<span>删除</span>
|
||||
</button>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
@ -27,6 +27,8 @@
|
|||
<label>手机号码</label>
|
||||
<input type="text" placeholder="手机号码" name="mobile" pattern="{{:lang('common_regex_mobile')}}" data-validation-message="手机号码格式错误" class="am-radius" {{if !empty($data)}}value="{{$data.mobile}}"{{/if}} />
|
||||
</div>
|
||||
{{include file="lib/gender" /}}
|
||||
|
||||
{{if !isset($data['id']) or $admin['id'] neq $data['id']}}
|
||||
<div class="am-form-group">
|
||||
<label>权限组</label>
|
||||
|
|
@ -38,7 +40,15 @@
|
|||
</select>
|
||||
</div>
|
||||
{{/if}}
|
||||
{{include file="lib/gender" /}}
|
||||
|
||||
<div class="am-form-group">
|
||||
<label>状态</label>
|
||||
<select name="status" class="am-radius chosen-select" data-validation-message="请选择用户状态" required>
|
||||
{{foreach :lang('common_admin_status_list') as $v}}
|
||||
<option value="{{$v.value}}" {{if isset($data['status']) and $data['status'] eq $v['value']}}selected{{else /}}{{if !isset($data['status']) and isset($v['checked']) and $v['checked'] eq true}}selected{{/if}}{{/if}}>{{$v.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- 插件扩展数据 start -->
|
||||
{{if isset($shopxo_is_develop) and $shopxo_is_develop eq true}}
|
||||
|
|
|
|||
|
|
@ -578,96 +578,113 @@
|
|||
{{/if}}
|
||||
{{if !empty($v['element'])}}
|
||||
{{foreach $v.element as $element}}
|
||||
<div class="am-form-group">
|
||||
<label class="block">{{$element.title}}{{if !empty($element['desc'])}}<span class="am-form-group-label-tips">{{$element.desc}}</span>{{/if}}</label>
|
||||
{{switch element.element}}
|
||||
{{case input}}
|
||||
{{if in_array($element['type'], ['radio', 'checkbox']) and !empty($element['element_data']) and is_array($element['element_data'])}}
|
||||
{{foreach $element.element_data as $element_data_key=>$element_data}}
|
||||
<label class="{{if isset($element['is_block']) and $element['is_block'] eq 1}}am-{{$element.type}}{{else /}}am-{{$element.type}}-inline{{/if}}">
|
||||
{{if !empty($element['name'])}}
|
||||
<div class="am-form-group">
|
||||
{{if !empty($element['title']) or !empty($element['desc'])}}
|
||||
<label class="block">
|
||||
{{if !empty($element['title'])}}
|
||||
{{$element.title}}
|
||||
{{/if}}
|
||||
{{if !empty($element['desc'])}}
|
||||
<span class="am-form-group-label-tips">{{$element.desc}}</span>
|
||||
{{/if}}
|
||||
</label>
|
||||
{{/if}}
|
||||
{{switch element.element}}
|
||||
{{case input}}
|
||||
{{if isset($element['type'])}}
|
||||
{{if in_array($element['type'], ['radio', 'checkbox']) and !empty($element['element_data']) and is_array($element['element_data'])}}
|
||||
{{foreach $element.element_data as $element_data_key=>$element_data}}
|
||||
<label class="{{if isset($element['is_block']) and $element['is_block'] eq 1}}am-{{$element.type}}{{else /}}am-{{$element.type}}-inline{{/if}}">
|
||||
<input
|
||||
type="{{$element.type}}"
|
||||
name="{{$element.name}}"
|
||||
value="{{$element_data.value}}"
|
||||
|
||||
{{if isset($data['config'][$element['name']]) and in_array($element_data['value'], explode(',', $data['config'][$element['name']]))}} checked{{/if}}
|
||||
|
||||
{{if isset($element['minchecked']) and $element['type'] eq 'checkbox'}} minchecked="{{$element.minchecked}}"{{/if}}
|
||||
|
||||
{{if isset($element['maxchecked']) and $element['type'] eq 'checkbox'}} maxchecked="{{$element.maxchecked}}"{{/if}}
|
||||
|
||||
{{if isset($element['message'])}} data-validation-message="{{$element.message}}"{{/if}}
|
||||
|
||||
{{if $element_data_key eq 0 and isset($element['is_required']) and $element['is_required'] eq 1}}required{{/if}}
|
||||
data-am-ucheck />
|
||||
{{$element_data.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
{{else /}}
|
||||
<input
|
||||
class="am-radius"
|
||||
type="{{$element.type}}"
|
||||
name="{{$element.name}}"
|
||||
value="{{$element_data.value}}"
|
||||
value="{{if isset($data['config'][$element['name']])}}{{$data['config'][$element['name']]}}{{else /}}{{if isset($element['default'])}}{{$element.default}}{{/if}}{{/if}}"
|
||||
|
||||
{{if isset($data['config'][$element['name']]) and in_array($element_data['value'], explode(',', $data['config'][$element['name']]))}} checked{{/if}}
|
||||
|
||||
{{if isset($element['minchecked']) and $element['type'] eq 'checkbox'}} minchecked="{{$element.minchecked}}"{{/if}}
|
||||
|
||||
{{if isset($element['maxchecked']) and $element['type'] eq 'checkbox'}} maxchecked="{{$element.maxchecked}}"{{/if}}
|
||||
{{if isset($element['placeholder'])}} placeholder="{{$element.placeholder}}"{{/if}}
|
||||
|
||||
{{if isset($element['message'])}} data-validation-message="{{$element.message}}"{{/if}}
|
||||
|
||||
{{if $element_data_key eq 0 and isset($element['is_required']) and $element['is_required'] eq 1}}required{{/if}}
|
||||
data-am-ucheck />
|
||||
{{$element_data.name}}
|
||||
</label>
|
||||
{{/foreach}}
|
||||
{{else /}}
|
||||
<input
|
||||
{{if isset($element['is_required']) and $element['is_required'] eq 1}} required{{/if}}
|
||||
/>
|
||||
{{/if}}
|
||||
{{else /}}
|
||||
<p class="am-text-danger">element input-type 配置有误</p>
|
||||
{{/if}}
|
||||
{{/case}}
|
||||
{{case select}}
|
||||
{{if !empty($element['element_data']) and is_array($element['element_data'])}}
|
||||
<select
|
||||
class="chosen-select am-radius"
|
||||
name="{{$element.name}}"
|
||||
|
||||
{{if isset($element['message'])}} data-validation-message="{{$element.message}}"{{/if}}
|
||||
|
||||
{{if !empty($element['placeholder'])}} data-placeholder="{{$element.placeholder}}"{{/if}}
|
||||
|
||||
{{if isset($element['is_multiple']) and $element['is_multiple'] eq 1}}
|
||||
multiple
|
||||
{{if isset($element['minchecked'])}} minchecked="{{$element.minchecked}}"{{/if}}
|
||||
{{if isset($element['maxchecked'])}} maxchecked="{{$element.maxchecked}}"{{/if}}
|
||||
{{/if}}
|
||||
|
||||
{{if isset($element['is_required']) and $element['is_required'] eq 1}}required{{/if}}
|
||||
>
|
||||
{{if !isset($element['is_multiple']) or $element['is_multiple'] neq 1}}
|
||||
{{if !empty($element['placeholder'])}}
|
||||
<option value="">{{$element.placeholder}}</option>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{foreach $element.element_data as $element_data_key=>$element_data}}
|
||||
<option
|
||||
value="{{$element_data.value}}"
|
||||
{{if isset($data['config'][$element['name']]) and in_array($element_data['value'], explode(',', $data['config'][$element['name']]))}}selected{{/if}}
|
||||
>{{$element_data.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
{{/if}}
|
||||
{{/case}}
|
||||
{{case textarea}}
|
||||
<textarea
|
||||
class="am-radius"
|
||||
type="{{$element.type}}"
|
||||
name="{{$element.name}}"
|
||||
value="{{if isset($data['config'][$element['name']])}}{{$data['config'][$element['name']]}}{{else /}}{{if isset($element['default'])}}{{$element.default}}{{/if}}{{/if}}"
|
||||
|
||||
{{if isset($element['rows'])}} rows="{{$element.rows}}"{{/if}}
|
||||
|
||||
{{if isset($element['placeholder'])}} placeholder="{{$element.placeholder}}"{{/if}}
|
||||
|
||||
{{if isset($element['message'])}} data-validation-message="{{$element.message}}"{{/if}}
|
||||
|
||||
{{if isset($element['is_required']) and $element['is_required'] eq 1}} required{{/if}}
|
||||
/>
|
||||
{{/if}}
|
||||
{{/case}}
|
||||
{{case select}}
|
||||
{{if !empty($element['element_data']) and is_array($element['element_data'])}}
|
||||
<select
|
||||
class="chosen-select am-radius"
|
||||
name="{{$element.name}}"
|
||||
|
||||
{{if isset($element['message'])}} data-validation-message="{{$element.message}}"{{/if}}
|
||||
|
||||
{{if !empty($element['placeholder'])}} data-placeholder="{{$element.placeholder}}"{{/if}}
|
||||
|
||||
{{if isset($element['is_multiple']) and $element['is_multiple'] eq 1}}
|
||||
multiple
|
||||
{{if isset($element['minchecked'])}} minchecked="{{$element.minchecked}}"{{/if}}
|
||||
{{if isset($element['maxchecked'])}} maxchecked="{{$element.maxchecked}}"{{/if}}
|
||||
{{if isset($element['is_required']) and $element['is_required'] eq 1}}
|
||||
{{if isset($element['minlength'])}} minlength="{{$element.minlength}}"{{/if}}
|
||||
{{if isset($element['maxlength'])}} maxlength="{{$element.maxlength}}"{{/if}}
|
||||
required
|
||||
{{/if}}
|
||||
|
||||
{{if isset($element['is_required']) and $element['is_required'] eq 1}}required{{/if}}
|
||||
>
|
||||
{{if !isset($element['is_multiple']) or $element['is_multiple'] neq 1}}
|
||||
{{if !empty($element['placeholder'])}}
|
||||
<option value="">{{$element.placeholder}}</option>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{foreach $element.element_data as $element_data_key=>$element_data}}
|
||||
<option
|
||||
value="{{$element_data.value}}"
|
||||
{{if isset($data['config'][$element['name']]) and in_array($element_data['value'], explode(',', $data['config'][$element['name']]))}}selected{{/if}}
|
||||
>{{$element_data.name}}</option>
|
||||
{{/foreach}}
|
||||
</select>
|
||||
{{/if}}
|
||||
{{/case}}
|
||||
{{case textarea}}
|
||||
<textarea
|
||||
class="am-radius"
|
||||
name="{{$element.name}}"
|
||||
|
||||
{{if isset($element['rows'])}} rows="{{$element.rows}}"{{/if}}
|
||||
|
||||
{{if isset($element['placeholder'])}} placeholder="{{$element.placeholder}}"{{/if}}
|
||||
|
||||
{{if isset($element['is_required']) and $element['is_required'] eq 1}}
|
||||
{{if isset($element['minlength'])}} minlength="{{$element.minlength}}"{{/if}}
|
||||
{{if isset($element['maxlength'])}} maxlength="{{$element.maxlength}}"{{/if}}
|
||||
required
|
||||
{{/if}}
|
||||
>{{if isset($data['config'][$element['name']])}}{{$data['config'][$element['name']]}}{{else /}}{{if isset($element['default'])}}{{$element.default}}{{/if}}{{/if}}</textarea>
|
||||
{{/case}}
|
||||
{{/switch}}
|
||||
</div>
|
||||
>{{if isset($data['config'][$element['name']])}}{{$data['config'][$element['name']]}}{{else /}}{{if isset($element['default'])}}{{$element.default}}{{/if}}{{/if}}</textarea>
|
||||
{{/case}}
|
||||
{{/switch}}
|
||||
</div>
|
||||
{{else /}}
|
||||
<p class="am-text-danger">element form-name 配置有误</p>
|
||||
{{/if}}
|
||||
{{/foreach}}
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class Plugins extends Common
|
|||
'error_msg' => '应用操作方法有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($this->data_request, $p);
|
||||
$ret = ParamsChecked($params['data_request'], $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
return DataReturn($ret, -5000);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class Plugins extends Common
|
|||
'error_msg' => '应用操作方法有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
$ret = ParamsChecked($params['data_request'], $p);
|
||||
if($ret !== true)
|
||||
{
|
||||
if(IS_AJAX)
|
||||
|
|
|
|||
|
|
@ -350,6 +350,12 @@ return array(
|
|||
4 => array('value' => 4, 'name' => '销售+自提', 'is_ext' => 1),
|
||||
),
|
||||
|
||||
// 管理员状态
|
||||
'common_admin_status_list' => array(
|
||||
0 => array('value' => 0, 'name' => '正常', 'checked' => true),
|
||||
1 => array('value' => 1, 'name' => '无效'),
|
||||
),
|
||||
|
||||
|
||||
// 色彩值
|
||||
'common_color_list' => array(
|
||||
|
|
|
|||
|
|
@ -42,57 +42,32 @@ class AdminService
|
|||
$data = Db::name('Admin')->where($where)->field($field)->order($order_by)->limit($m, $n)->select();
|
||||
if(!empty($data))
|
||||
{
|
||||
// 获取当前用户角色名称
|
||||
$roles = Db::name('Role')->where('id', 'in', array_column($data, 'role_id'))->column('name', 'id');
|
||||
|
||||
// 数据处理
|
||||
$common_gender_list = lang('common_gender_list');
|
||||
$common_admin_status_list = lang('common_admin_status_list');
|
||||
foreach($data as &$v)
|
||||
{
|
||||
$v['role_name'] = Db::name('Role')->where(['id'=>$v['role_id']])->value('name');
|
||||
// 所在角色组
|
||||
$v['role_name'] = isset($roles[$v['role_id']]) ? $roles[$v['role_id']] : '';
|
||||
|
||||
// 性别
|
||||
$v['gender_text'] = isset($common_gender_list[$v['gender']]) ? $common_gender_list[$v['gender']]['name'] : '';
|
||||
|
||||
// 状态
|
||||
$v['status_text'] = isset($common_admin_status_list[$v['status']]) ? $common_admin_status_list[$v['status']]['name'] : '';
|
||||
|
||||
// 时间
|
||||
$v['login_time'] = empty($v['login_time']) ? '' : date('Y-m-d H:i:s', $v['login_time']);
|
||||
$v['add_time'] = empty($v['add_time']) ? '' : date('Y-m-d H:i:s', $v['add_time']);
|
||||
$v['upd_time'] = empty($v['upd_time']) ? '' : date('Y-m-d H:i:s', $v['upd_time']);
|
||||
}
|
||||
}
|
||||
return DataReturn('处理成功', 0, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员列表条件
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 0.0.1
|
||||
* @datetime 2016-12-10T22:16:29+0800
|
||||
* @param [array] $params [输入参数]
|
||||
*/
|
||||
public static function AdminListWhere($params = [])
|
||||
{
|
||||
$where = [];
|
||||
if(!empty($params['keywords']))
|
||||
{
|
||||
$where[] = ['username|mobile', 'like', '%'.$params['keywords'].'%'];
|
||||
}
|
||||
|
||||
// 是否更多条件
|
||||
if(isset($params['is_more']) && $params['is_more'] == 1)
|
||||
{
|
||||
if(isset($params['role_id']) && $params['role_id'] > -1)
|
||||
{
|
||||
$where[] = ['role_id', '=', intval($params['role_id'])];
|
||||
}
|
||||
|
||||
// 等值
|
||||
if(isset($params['gender']) && $params['gender'] > -1)
|
||||
{
|
||||
$where[] = ['gender', '=', intval($params['gender'])];
|
||||
}
|
||||
|
||||
if(!empty($params['time_start']))
|
||||
{
|
||||
$where[] = ['add_time', '>', strtotime($params['time_start'])];
|
||||
}
|
||||
if(!empty($params['time_end']))
|
||||
{
|
||||
$where[] = ['add_time', '<', strtotime($params['time_end'])];
|
||||
}
|
||||
}
|
||||
|
||||
return $where;
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员总数
|
||||
* @author Devil
|
||||
|
|
@ -152,6 +127,12 @@ class AdminService
|
|||
'checked_data' => [0,1,2],
|
||||
'error_msg' => '性别值范围不正确',
|
||||
],
|
||||
[
|
||||
'checked_type' => 'in',
|
||||
'key_name' => 'status',
|
||||
'checked_data' => array_column(lang('common_admin_status_list'), 'value'),
|
||||
'error_msg' => '状态值范围不正确',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
|
|
@ -221,6 +202,7 @@ class AdminService
|
|||
'login_pwd' => LoginPwdEncryption($params['login_pwd'], $salt),
|
||||
'mobile' => isset($params['mobile']) ? $params['mobile'] : '',
|
||||
'gender' => intval($params['gender']),
|
||||
'status' => intval($params['status']),
|
||||
'role_id' => intval($params['role_id']),
|
||||
'add_time' => time(),
|
||||
];
|
||||
|
|
@ -277,6 +259,7 @@ class AdminService
|
|||
$data = [
|
||||
'mobile' => isset($params['mobile']) ? $params['mobile'] : '',
|
||||
'gender' => intval($params['gender']),
|
||||
'status' => intval($params['status']),
|
||||
'upd_time' => time(),
|
||||
];
|
||||
|
||||
|
|
@ -316,26 +299,29 @@ class AdminService
|
|||
*/
|
||||
public static function AdminDelete($params = [])
|
||||
{
|
||||
// 请求参数
|
||||
$p = [
|
||||
[
|
||||
'checked_type' => 'empty',
|
||||
'key_name' => 'id',
|
||||
'error_msg' => '删除id有误',
|
||||
],
|
||||
];
|
||||
$ret = ParamsChecked($params, $p);
|
||||
if($ret !== true)
|
||||
// 参数是否有误
|
||||
if(empty($params['ids']))
|
||||
{
|
||||
return DataReturn($ret, -1);
|
||||
return DataReturn('商品id有误', -1);
|
||||
}
|
||||
// 是否数组
|
||||
if(!is_array($params['ids']))
|
||||
{
|
||||
$params['ids'] = explode(',', $params['ids']);
|
||||
}
|
||||
|
||||
// 是否包含删除超级管理员
|
||||
if(in_array(1, $params['ids']))
|
||||
{
|
||||
return DataReturn('超级管理员不可删除', -1);
|
||||
}
|
||||
|
||||
// 删除操作
|
||||
if(Db::name('Admin')->delete(intval($params['id'])))
|
||||
if(Db::name('Admin')->where(['id'=>$params['ids']])->delete())
|
||||
{
|
||||
return DataReturn('删除成功');
|
||||
}
|
||||
return DataReturn('删除失败或资源不存在', -100);
|
||||
return DataReturn('删除失败', -100);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -557,6 +557,12 @@ use think\Controller;
|
|||
*/
|
||||
class Admin extends Controller
|
||||
{
|
||||
// 构造方法
|
||||
public function __construct(\$params = [])
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
// 后台管理入口
|
||||
public function index(\$params = [])
|
||||
{
|
||||
|
|
@ -621,6 +627,12 @@ use think\Controller;
|
|||
*/
|
||||
class Index extends Controller
|
||||
{
|
||||
// 构造方法
|
||||
public function __construct(\$params = [])
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
// 前端页面入口
|
||||
public function index(\$params = [])
|
||||
{
|
||||
|
|
|
|||
|
|
@ -246,6 +246,12 @@ class PluginsService
|
|||
{
|
||||
return DataReturn('应用方法未定义['.$action.']', -1);
|
||||
}
|
||||
|
||||
// 调用方法仅传递请求参数
|
||||
if(isset($params['data_request']))
|
||||
{
|
||||
$params = $params['data_request'];
|
||||
}
|
||||
return DataReturn('验证成功', 0, $obj->$action($params));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,21 +32,57 @@ return array (
|
|||
'log_write' =>
|
||||
array (
|
||||
),
|
||||
'plugins_css' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_users_center_left_menu_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_header_navigation_top_right_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_order_status_change_history_success_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\neworderemail\\Hook',
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_order_pay_launch_handle' =>
|
||||
'plugins_service_order_aftersale_audit_handle_end' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\neworderemail\\Hook',
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_admin_js' =>
|
||||
'plugins_service_site_extraction_address_list' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\orderremind\\Hook',
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_admin_view_common_bottom' =>
|
||||
'plugins_service_buy_order_insert_end' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\orderremind\\Hook',
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_goods_spec_extends_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_view_admin_user_save' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_service_user_save_handle' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_view_goods_detail_base_buy_nav_min_inside' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_view_goods_detail_photo_within' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
'plugins_view_goods_detail_base_bottom' =>
|
||||
array (
|
||||
0 => 'app\\plugins\\distribution\\Hook',
|
||||
),
|
||||
);
|
||||
?>
|
||||
|
|
@ -133,7 +133,7 @@ color: #F5F5F2;font-size: 12px;cursor:pointer;border-radius:0px 0px; position: a
|
|||
.goods-category-s .category-content{ position:relative; width: 150px; float: left; z-index: 113;background:#fff; top: 45px;}
|
||||
.goods-category-s .category-content .all-goods { display: block; padding: 0; border-radius: 5px 5px 0 0; font-weight: 600; line-height: 36px;width:150px;height: 36px; padding: 0; border-radius: 5px 5px 0 0; color: #fff; text-align: center; font: 16px/36px "Microsoft YaHei";}
|
||||
.goods-category-s .category-content .all-goods em{ font: 12px/36px "Microsoft YaHei"; }
|
||||
.category-content .category{width:150px; border-top: none; background: #2b2b2b;box-shadow: 8px 0 7px -3px rgba(0,0,0,.3); max-height: 360px; overflow-y: auto; overflow-x: hidden; }
|
||||
.category-content .category{width:150px; border-top: none; background: #2b2b2b;box-shadow: 8px 0 7px -3px rgba(0,0,0,.3); }
|
||||
.category-content .down-ico{ position: absolute; top: 48px; left: 95px; width: 10px; height: 6px; background-position: 0 -131px; z-index: 11111; }
|
||||
.category-content .category-list li { height:36px; margin-top: -2px;z-index:113;border-top: 1px solid #333;border-bottom: 1px solid #252525}
|
||||
.category-content .category-list li.first{ margin-top: 0; }
|
||||
|
|
@ -198,7 +198,7 @@ color: #F5F5F2;font-size: 12px;cursor:pointer;border-radius:0px 0px; position: a
|
|||
/* 分类 */
|
||||
#goods-category .category-content{ position:relative; width: 180px; float: left; z-index: 113; top: 45px; }
|
||||
#goods-category .category-content .all-goods { width:180px; }
|
||||
.category-content .category{ width:180px; max-height: 430px; }
|
||||
.category-content .category{ width:180px; }
|
||||
.category-content .category-info { padding-left: 12px;width: 180px;overflow: hidden; }
|
||||
.category-content .menu-item { left: 179px; height: 430px; }
|
||||
.category-content .category-list li { height:43px; }
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class Controller
|
|||
* 构造方法
|
||||
* @access public
|
||||
*/
|
||||
public function __construct(App $app = null)
|
||||
/*public function __construct(App $app = null)
|
||||
{
|
||||
$this->app = $app ?: Container::get('app');
|
||||
$this->request = $this->app['request'];
|
||||
|
|
@ -69,6 +69,35 @@ class Controller
|
|||
|
||||
$this->registerMiddleware();
|
||||
|
||||
// 前置操作方法 即将废弃
|
||||
foreach ((array) $this->beforeActionList as $method => $options) {
|
||||
is_numeric($method) ?
|
||||
$this->beforeAction($options) :
|
||||
$this->beforeAction($method, $options);
|
||||
}
|
||||
}*/
|
||||
|
||||
/**
|
||||
* 构造方法
|
||||
* @author Devil
|
||||
* @blog http://gong.gg/
|
||||
* @version 1.0.0
|
||||
* @date 2020-06-11
|
||||
* @desc description
|
||||
* @param [type] $app [description]
|
||||
*/
|
||||
public function __construct($app = null)
|
||||
{
|
||||
// 实例化控制器,构造方法参数可传非对象数据
|
||||
$this->app = is_object($app) ? $app : Container::get('app');
|
||||
$this->request = $this->app['request'];
|
||||
$this->view = $this->app['view'];
|
||||
|
||||
// 控制器初始化
|
||||
$this->initialize();
|
||||
|
||||
$this->registerMiddleware();
|
||||
|
||||
// 前置操作方法 即将废弃
|
||||
foreach ((array) $this->beforeActionList as $method => $options) {
|
||||
is_numeric($method) ?
|
||||
|
|
|
|||
Loading…
Reference in New Issue