调整结构
|
|
@ -4,7 +4,6 @@
|
|||
namespace app\admin\model;
|
||||
|
||||
use app\admin\model\BaseModel;
|
||||
use app\admin\model\wechat\WechatUser;
|
||||
use think\facade\Cache;
|
||||
use think\facade\Session;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | HulaCWMS 呼啦企业网站管理系统
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2019 http://www.zhuopro.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: 灼灼文化
|
||||
// +----------------------------------------------------------------------
|
||||
use think\facade\Db;
|
||||
use think\Exception;
|
||||
|
|
@ -399,7 +394,6 @@ function tpl_get_list($orderby,$pagesize,$cid,$type,$table='article',$where=fals
|
|||
return $re;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据栏目类型,生成栏目url
|
||||
*/
|
||||
|
|
@ -571,8 +565,6 @@ function tpl_get_banner($type,$row){
|
|||
return $bannerListTemp;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!function_exists('web_config'))
|
||||
{
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -2,9 +2,30 @@
|
|||
// +----------------------------------------------------------------------
|
||||
// | 模板设置
|
||||
// +----------------------------------------------------------------------
|
||||
//第一步判断选择的模板
|
||||
$theme = system_config('web_template');
|
||||
//检查主题目录是否存在,不存在则更新为默认目录
|
||||
if (file_exists(public_path("template/{$theme}"))){
|
||||
|
||||
$theme = 'default';
|
||||
}
|
||||
//检查是否切换模板
|
||||
if(ismobile() == "wap" && file_exists(public_path("template/{$theme}/mobile"))) {
|
||||
$mode = "mobile/";
|
||||
} else {
|
||||
$mode = "pc/";
|
||||
}
|
||||
return [
|
||||
// 模板路径
|
||||
'taglib_pre_load' => 'app\common\taglib\Zz',
|
||||
'view_path' => './template/default/',
|
||||
// 模板路径
|
||||
'view_path' => './template/' .$theme.'/'.$mode,
|
||||
// 视图输出字符串内容替换
|
||||
'tpl_replace_string' => [
|
||||
'__STATIC__' => '/static',
|
||||
'__LIB__' => '/template/' .$theme.'/'.$mode.'/lib',
|
||||
'__IMG__' => '/template/' .$theme.'/'.$mode.'/img',
|
||||
'__CSS__' => '/template/' .$theme.'/'.$mode.'/css',
|
||||
'__JS__' => '/template/' .$theme.'/'.$mode.'/js'
|
||||
],
|
||||
];
|
||||
|
|
|
|||
|
|
@ -31,14 +31,6 @@ class Base extends BaseController
|
|||
cache('systemConfig',$systemConfig);
|
||||
}
|
||||
$this->systemConfig = $systemConfig;
|
||||
//系统模板目录,兼容模板标签 include
|
||||
$templatePath = public_path(config('view.view_path'));
|
||||
if (!file_exists($templatePath)){
|
||||
//检查主题目录是否存在,不存在则更新为默认目录
|
||||
$templatePath = public_path('template/default/');
|
||||
config(['view_path'=>'./template/default/'],'view');
|
||||
}
|
||||
define('TPL',$templatePath);
|
||||
//判断是否关闭站点。
|
||||
if(!$systemConfig['web_close']){
|
||||
$this->error('网站暂时关闭!','','stop');
|
||||
|
|
|
|||
|
|
@ -0,0 +1,41 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace app\index\model;
|
||||
|
||||
/**
|
||||
* Class Document
|
||||
* @package app\admin\model\system
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:22
|
||||
*/
|
||||
class Document extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
* @param $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:24
|
||||
*/
|
||||
public static function systemPage($where): array
|
||||
{
|
||||
$model = new self;
|
||||
$count = self::counts($model);
|
||||
if ($where['page'] && $where['limit']) $model = $model->page((int)$where['page'],(int)$where['limit']);
|
||||
$data = $model->select();
|
||||
if ($data) $data = $data->toArray();
|
||||
$categoryList = DocumentCategory::where('id','in',array_column($data,'category_id'))->column('title','id');
|
||||
foreach ($data as &$item){
|
||||
if (!empty($categoryList[$item['category_id']])){
|
||||
$item['category_title'] = $categoryList[$item['category_id']];
|
||||
}else{
|
||||
$item['category_title'] = '';
|
||||
}
|
||||
}
|
||||
return compact('data','count');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace app\index\model;
|
||||
|
||||
|
||||
use app\admin\model\BaseModel;
|
||||
|
||||
/**
|
||||
* Class DocumentArticle
|
||||
* @package app\admin\model\system
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:22
|
||||
*/
|
||||
class DocumentArticle extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
* @param $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:24
|
||||
*/
|
||||
public static function systemPage($where): array
|
||||
{
|
||||
$model = new self;
|
||||
$count = self::counts($model);
|
||||
if ($where['page'] && $where['limit']) $model = $model->page((int)$where['page'],(int)$where['limit']);
|
||||
$data = $model->select();
|
||||
if ($data) $data = $data->toArray();
|
||||
return compact('data','count');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace app\index\model;
|
||||
|
||||
|
||||
use app\admin\model\BaseModel;
|
||||
|
||||
/**
|
||||
* Class DocumentCategory
|
||||
* @package app\admin\model\system
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:22
|
||||
*/
|
||||
class DocumentCategory extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
* @param $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:24
|
||||
*/
|
||||
public static function systemPage($where): array
|
||||
{
|
||||
$model = new self;
|
||||
$model = $model->field(['id','pid','title','sort','display'])->order('sort asc,id asc');
|
||||
if (isset($where['title']) && $where['title'] != '') $model = $model->where("title|id","like","%$where[title]%");
|
||||
$data = $model->select();
|
||||
return $data->toArray() ?: [];
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询分类选择类型
|
||||
* @param int $type
|
||||
* @param array $ids
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public static function selectByType(int $type = 0,array $ids = [])
|
||||
{
|
||||
$model = new self;
|
||||
if (!empty($ids)) $model = $model->where("id","not in", $ids);
|
||||
if ($type != 0) $model = $model->where("type",$type);
|
||||
$model = $model->where("status",1);
|
||||
$model = $model->field("id,title");
|
||||
$data = $model->select();
|
||||
return $data ? $data->toArray() : [];
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace app\index\model;
|
||||
|
||||
|
||||
use app\admin\model\BaseModel;
|
||||
|
||||
/**
|
||||
* Class DocumentCategoryContent
|
||||
* @package app\admin\model\system
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:22
|
||||
*/
|
||||
class DocumentCategoryContent extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
* @param $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:24
|
||||
*/
|
||||
public static function systemPage($where): array
|
||||
{
|
||||
$model = new self;
|
||||
$count = self::counts($model);
|
||||
if ($where['page'] && $where['limit']) $model = $model->page((int)$where['page'],(int)$where['limit']);
|
||||
$data = $model->select();
|
||||
if ($data) $data = $data->toArray();
|
||||
return compact('data','count');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace app\index\model;
|
||||
|
||||
|
||||
use app\admin\model\BaseModel;
|
||||
|
||||
/**
|
||||
* Class DocumentProduct
|
||||
* @package app\admin\model\system
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:22
|
||||
*/
|
||||
class DocumentProduct extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
* @param $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:24
|
||||
*/
|
||||
public static function systemPage($where): array
|
||||
{
|
||||
$model = new self;
|
||||
$count = self::counts($model);
|
||||
if ($where['page'] && $where['limit']) $model = $model->page((int)$where['page'],(int)$where['limit']);
|
||||
$data = $model->select();
|
||||
if ($data) $data = $data->toArray();
|
||||
return compact('data','count');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace app\index\model;
|
||||
|
||||
|
||||
use app\admin\model\BaseModel;
|
||||
|
||||
/**
|
||||
* Class FriendLink
|
||||
* @package app\admin\model\system
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:22
|
||||
*/
|
||||
class FriendLink extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
* @param $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:24
|
||||
*/
|
||||
public static function systemPage($where): array
|
||||
{
|
||||
$model = new self;
|
||||
if ($where['title'] != '') $model = $model->where("title|url","like","%$where[title]%");
|
||||
if ($where['start_time'] != '') $model = $model->where("create_time",">",strtotime($where['start_time']." 00:00:00"));
|
||||
if ($where['end_time'] != '') $model = $model->where("create_time","<", strtotime($where['end_time']." 23:59:59"));
|
||||
if ($where['status'] != '') $model = $model->where("status",$where['status']);
|
||||
$count = self::counts($model);
|
||||
if ($where['page'] && $where['limit']) $model = $model->page((int)$where['page'],(int)$where['limit']);
|
||||
$data = $model->select();
|
||||
if ($data) $data = $data->toArray();
|
||||
return compact('data','count');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace app\index\model;
|
||||
|
||||
|
||||
use app\admin\model\BaseModel;
|
||||
|
||||
/**
|
||||
* Class Document
|
||||
* @package app\admin\model\system
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:22
|
||||
*/
|
||||
class MessageForm extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
* @param $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:24
|
||||
*/
|
||||
public static function systemPage($where): array
|
||||
{
|
||||
$model = new self;
|
||||
$model = $model->order('create_time','desc');
|
||||
if (isset($where['name']) && $where['name'] !== '') $model->where('name', "like", "%$where[name]%");
|
||||
if (isset($where['email']) && $where['email'] !== '') $model->where('email', "like", "%$where[email]%");
|
||||
if (isset($where['tel']) && $where['tel'] !== '') $model->where('tel', "like", "%$where[tel]%");
|
||||
if (isset($where['start_time']) && $where['start_time'] != '') $model = $model->where("m.created_at", ">", strtotime($where['start_time'] . " 00:00:00"));
|
||||
if (isset($where['end_time']) && $where['end_time'] != '') $model = $model->where("m.created_at", "<", strtotime($where['end_time'] . " 23:59:59"));
|
||||
$count = self::counts($model);
|
||||
if ($where['page'] && $where['limit']) $model = $model->page((int)$where['page'],(int)$where['limit']);
|
||||
$data = $model->select();
|
||||
if ($data) $data = $data->toArray();
|
||||
return compact('data','count');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
|
||||
namespace app\index\model;
|
||||
|
||||
|
||||
use app\admin\model\BaseModel;
|
||||
|
||||
/**
|
||||
* Class Slides
|
||||
* @package app\admin\model\system
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:22
|
||||
*/
|
||||
class Slides extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 列表
|
||||
* @param $where
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
* @author 李玉坤
|
||||
* @date 2021-02-15 23:24
|
||||
*/
|
||||
public static function systemPage($where): array
|
||||
{
|
||||
$model = new self;
|
||||
$count = self::counts($model);
|
||||
if ($where['page'] && $where['limit']) $model = $model->page((int)$where['page'],(int)$where['limit']);
|
||||
$data = $model->select()->each(function ($item){
|
||||
if (!empty($item->pic)){
|
||||
$item->pic = file_cdn($item->pic);
|
||||
}
|
||||
});
|
||||
if ($data) $data = $data->toArray();
|
||||
return compact('data','count');
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 5.3 KiB After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 8.9 KiB After Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 4.8 KiB |
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 4.3 KiB After Width: | Height: | Size: 4.3 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.0 KiB |
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
|
Before Width: | Height: | Size: 9.5 KiB After Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 5.7 KiB After Width: | Height: | Size: 5.7 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 23 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 5.9 KiB After Width: | Height: | Size: 5.9 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
|
Before Width: | Height: | Size: 6.6 KiB After Width: | Height: | Size: 6.6 KiB |
|
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
|
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |