[更新]更新系统模块及配置文件

This commit is contained in:
邹景立 2017-04-05 10:25:41 +08:00
parent 34abaaedb5
commit 71b6ca76de
5 changed files with 15 additions and 37 deletions

View File

@ -45,7 +45,7 @@ class Auth extends BasicAdmin {
/**
* 权限授权
* @return void
* @return string|array
*/
public function apply() {
$auth_id = $this->request->get('id', '0');
@ -77,6 +77,12 @@ class Auth extends BasicAdmin {
}
}
/**
* 节点数据拼装
* @param array $nodes
* @param int $level
* @return array
*/
protected function _filterNodes($nodes, $level = 1) {
foreach ($nodes as $key => &$node) {
if (!empty($node['_sub_']) && is_array($node['_sub_'])) {

View File

@ -36,8 +36,8 @@ class Index extends BasicAdmin {
*/
public function index() {
Node::applyAuthNode();
$list = Db::name('SystemMenu')->field('title,id,pid,url,icon')->order('sort asc,id asc')->where('status', '1')->select();
$menus = $this->_filter_menu(ToolsService::arr2tree($list));
$list = Db::name('SystemMenu')->where('status', '1')->order('sort asc,id asc')->select();
$menus = $this->_filterMenu(ToolsService::arr2tree($list));
$this->assign('title', '后台管理');
$this->assign('menus', $menus);
return view();
@ -48,10 +48,10 @@ class Index extends BasicAdmin {
* @param array $menus
* @return array
*/
private function _filter_menu($menus) {
private function _filterMenu($menus) {
foreach ($menus as $key => &$menu) {
if (!empty($menu['sub'])) {
$menu['sub'] = $this->_filter_menu($menu['sub']);
$menu['sub'] = $this->_filterMenu($menu['sub']);
}
if (!empty($menu['sub'])) {
$menu['url'] = '#';

View File

@ -104,7 +104,9 @@ class Menu extends BasicAdmin {
}
$this->assign('nodes', array_column($nodes, 'node'));
$this->assign('menus', $menus);
}
}else{
$this->error('请不要改菜单构造!');
}
}
/**

View File

@ -13,7 +13,7 @@
// +----------------------------------------------------------------------
/**
* 小程序配置参数
* 公众号配置参数
* @return array
*/
return [

View File

@ -14,7 +14,6 @@
namespace app\index\controller;
use library\Http;
use think\Controller;
use think\Db;
@ -28,34 +27,5 @@ class Index extends Controller {
return view();
}
public function test() {
$DEVICE_NO = 'kdt1080126';
$key = '20585';
$content = "";
$content .= "^Q +http://weixin.qq.com/r/2Eg2LkzEKRFWrQhN9123";
$result = $this->sendSelfFormatOrderInfo($DEVICE_NO, $key, 1, $content);
var_dump($result);
}
function sendSelfFormatOrderInfo($device_no, $key, $times, $orderInfo) { // $times打印次数
$selfMessage = array(
'deviceNo' => $device_no,
'printContent' => $orderInfo,
'key' => $key,
'times' => $times
);
$url = "http://open.printcenter.cn:8080/addOrder";
$options = [
'http' => [
'header' => "Content-type: application/x-www-form-urlencoded ",
'method' => 'POST',
'content' => http_build_query($selfMessage),
],
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
return $result;
}
}