新闻管理,接口
团务百科管理,接口 信息公开管理,接口
This commit is contained in:
parent
dbdfa8528a
commit
03c19a0c31
38
application/admin/controller/home/Encyclopedia.php
Normal file
38
application/admin/controller/home/Encyclopedia.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\controller\home;
|
||||||
|
|
||||||
|
use app\common\controller\Backend;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团务百科
|
||||||
|
*
|
||||||
|
* @icon fa fa-circle-o
|
||||||
|
*/
|
||||||
|
class Encyclopedia extends Backend
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Encyclopedia模型对象
|
||||||
|
* @var \app\admin\model\home\Encyclopedia
|
||||||
|
*/
|
||||||
|
protected $model = null;
|
||||||
|
|
||||||
|
public function _initialize()
|
||||||
|
{
|
||||||
|
parent::_initialize();
|
||||||
|
$this->model = new \app\admin\model\home\Encyclopedia;
|
||||||
|
$this->view->assign("typeList", $this->model->getTypeList());
|
||||||
|
$this->view->assign("recommendList", $this->model->getRecommendList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||||
|
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||||
|
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
38
application/admin/controller/home/Information.php
Normal file
38
application/admin/controller/home/Information.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\controller\home;
|
||||||
|
|
||||||
|
use app\common\controller\Backend;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息公开
|
||||||
|
*
|
||||||
|
* @icon fa fa-circle-o
|
||||||
|
*/
|
||||||
|
class Information extends Backend
|
||||||
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Information模型对象
|
||||||
|
* @var \app\admin\model\home\Information
|
||||||
|
*/
|
||||||
|
protected $model = null;
|
||||||
|
|
||||||
|
public function _initialize()
|
||||||
|
{
|
||||||
|
parent::_initialize();
|
||||||
|
$this->model = new \app\admin\model\home\Information;
|
||||||
|
$this->view->assign("typeList", $this->model->getTypeList());
|
||||||
|
$this->view->assign("recommendList", $this->model->getRecommendList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||||
|
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||||
|
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -22,7 +22,10 @@ class News extends Backend
|
|||||||
{
|
{
|
||||||
parent::_initialize();
|
parent::_initialize();
|
||||||
$this->model = new \app\admin\model\home\News;
|
$this->model = new \app\admin\model\home\News;
|
||||||
|
$this->view->assign("typeList", $this->model->getTypeList());
|
||||||
$this->view->assign("recommendList", $this->model->getRecommendList());
|
$this->view->assign("recommendList", $this->model->getRecommendList());
|
||||||
|
$this->view->assign("hotList", $this->model->getHotList());
|
||||||
|
$this->view->assign("fineList", $this->model->getFineList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@ class NewsCate extends Backend
|
|||||||
{
|
{
|
||||||
parent::_initialize();
|
parent::_initialize();
|
||||||
$this->model = new \app\admin\model\home\NewsCate;
|
$this->model = new \app\admin\model\home\NewsCate;
|
||||||
|
$this->view->assign("homeList", $this->model->getHomeList());
|
||||||
$this->view->assign("statusList", $this->model->getStatusList());
|
$this->view->assign("statusList", $this->model->getStatusList());
|
||||||
$this->view->assign("hotList", $this->model->getHotList());
|
$this->view->assign("hotList", $this->model->getHotList());
|
||||||
}
|
}
|
||||||
|
23
application/admin/lang/zh-cn/home/encyclopedia.php
Normal file
23
application/admin/lang/zh-cn/home/encyclopedia.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'Title' => '标题',
|
||||||
|
'Subtitle' => '副标题',
|
||||||
|
'Source' => '来源',
|
||||||
|
'Image' => '封面',
|
||||||
|
'Type' => '文章类型',
|
||||||
|
'Type 1' => '富文本',
|
||||||
|
'Type 2' => 'PDF文档',
|
||||||
|
'Content' => '内容',
|
||||||
|
'File' => '附件',
|
||||||
|
'Recommend' => '置顶',
|
||||||
|
'Recommend 0' => '否',
|
||||||
|
'Recommend 1' => '是',
|
||||||
|
'Weigh' => '权重',
|
||||||
|
'Release_time' => '发布时间',
|
||||||
|
'Views' => '浏览量',
|
||||||
|
'Virtual_views' => '虚拟浏览量',
|
||||||
|
'Createtime' => '创建时间',
|
||||||
|
'Updatetime' => '修改时间',
|
||||||
|
'Deletetime' => '删除时间'
|
||||||
|
];
|
23
application/admin/lang/zh-cn/home/information.php
Normal file
23
application/admin/lang/zh-cn/home/information.php
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
return [
|
||||||
|
'Title' => '标题',
|
||||||
|
'Subtitle' => '副标题',
|
||||||
|
'Source' => '来源',
|
||||||
|
'Image' => '封面',
|
||||||
|
'Type' => '文章类型',
|
||||||
|
'Type 1' => '富文本',
|
||||||
|
'Type 2' => 'PDF文档',
|
||||||
|
'Content' => '内容',
|
||||||
|
'File' => '附件',
|
||||||
|
'Recommend' => '置顶',
|
||||||
|
'Recommend 0' => '否',
|
||||||
|
'Recommend 1' => '是',
|
||||||
|
'Weigh' => '权重',
|
||||||
|
'Release_time' => '发布时间',
|
||||||
|
'Views' => '浏览量',
|
||||||
|
'Virtual_views' => '虚拟浏览量',
|
||||||
|
'Createtime' => '创建时间',
|
||||||
|
'Updatetime' => '修改时间',
|
||||||
|
'Deletetime' => '删除时间'
|
||||||
|
];
|
@ -2,16 +2,29 @@
|
|||||||
|
|
||||||
return [
|
return [
|
||||||
'Cate_id' => '新闻类目',
|
'Cate_id' => '新闻类目',
|
||||||
|
'Flag' => '分类标识',
|
||||||
'Title' => '新闻标题',
|
'Title' => '新闻标题',
|
||||||
'Subtitle' => '新闻副标题',
|
'Subtitle' => '新闻副标题',
|
||||||
|
'Source' => '来源',
|
||||||
'Image' => '封面',
|
'Image' => '封面',
|
||||||
|
'Type' => '文章类型',
|
||||||
|
'Type 1' => '富文本',
|
||||||
|
'Type 2' => 'PDF文档',
|
||||||
'Content' => '内容',
|
'Content' => '内容',
|
||||||
|
'File' => '附件',
|
||||||
'Recommend' => '置顶',
|
'Recommend' => '置顶',
|
||||||
'Recommend 0' => '否',
|
'Recommend 0' => '否',
|
||||||
'Recommend 1' => '是',
|
'Recommend 1' => '是',
|
||||||
|
'Hot' => '热门',
|
||||||
|
'Hot 0' => '否',
|
||||||
|
'Hot 1' => '是',
|
||||||
|
'Fine' => '精选',
|
||||||
|
'Fine 0' => '否',
|
||||||
|
'Fine 1' => '是',
|
||||||
'Weigh' => '权重',
|
'Weigh' => '权重',
|
||||||
'Release_time' => '发布时间',
|
'Release_time' => '发布时间',
|
||||||
'Views' => '浏览量',
|
'Views' => '浏览量',
|
||||||
|
'Virtual_views' => '虚拟浏览量',
|
||||||
'Createtime' => '创建时间',
|
'Createtime' => '创建时间',
|
||||||
'Updatetime' => '修改时间',
|
'Updatetime' => '修改时间',
|
||||||
'Deletetime' => '删除时间',
|
'Deletetime' => '删除时间',
|
||||||
|
@ -3,6 +3,10 @@
|
|||||||
return [
|
return [
|
||||||
'Image' => 'icon',
|
'Image' => 'icon',
|
||||||
'Name' => '类目名',
|
'Name' => '类目名',
|
||||||
|
'Flag' => '分类标识',
|
||||||
|
'Home' => '首页',
|
||||||
|
'Home 0' => '否',
|
||||||
|
'Home 1' => '是',
|
||||||
'Status' => '状态',
|
'Status' => '状态',
|
||||||
'Status 1' => '上架',
|
'Status 1' => '上架',
|
||||||
'Set status to 1'=> '设为上架',
|
'Set status to 1'=> '设为上架',
|
||||||
|
84
application/admin/model/home/Encyclopedia.php
Normal file
84
application/admin/model/home/Encyclopedia.php
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\model\home;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
use traits\model\SoftDelete;
|
||||||
|
|
||||||
|
class Encyclopedia extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
use SoftDelete;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $name = 'encyclopedia';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = 'integer';
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = 'createtime';
|
||||||
|
protected $updateTime = 'updatetime';
|
||||||
|
protected $deleteTime = 'deletetime';
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
'type_text',
|
||||||
|
'recommend_text',
|
||||||
|
'release_time_text'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
protected static function init()
|
||||||
|
{
|
||||||
|
self::afterInsert(function ($row) {
|
||||||
|
if (!$row['weigh']) {
|
||||||
|
$pk = $row->getPk();
|
||||||
|
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTypeList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Type 1'), '2' => __('Type 2')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRecommendList()
|
||||||
|
{
|
||||||
|
return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTypeTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['type'] ?? '');
|
||||||
|
$list = $this->getTypeList();
|
||||||
|
return $list[$value] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getRecommendTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['recommend'] ?? '');
|
||||||
|
$list = $this->getRecommendList();
|
||||||
|
return $list[$value] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getReleaseTimeTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['release_time'] ?? '');
|
||||||
|
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setReleaseTimeAttr($value)
|
||||||
|
{
|
||||||
|
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
84
application/admin/model/home/Information.php
Normal file
84
application/admin/model/home/Information.php
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\model\home;
|
||||||
|
|
||||||
|
use think\Model;
|
||||||
|
use traits\model\SoftDelete;
|
||||||
|
|
||||||
|
class Information extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
use SoftDelete;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $name = 'information';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = 'integer';
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = 'createtime';
|
||||||
|
protected $updateTime = 'updatetime';
|
||||||
|
protected $deleteTime = 'deletetime';
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
'type_text',
|
||||||
|
'recommend_text',
|
||||||
|
'release_time_text'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
protected static function init()
|
||||||
|
{
|
||||||
|
self::afterInsert(function ($row) {
|
||||||
|
if (!$row['weigh']) {
|
||||||
|
$pk = $row->getPk();
|
||||||
|
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTypeList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Type 1'), '2' => __('Type 2')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRecommendList()
|
||||||
|
{
|
||||||
|
return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTypeTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['type'] ?? '');
|
||||||
|
$list = $this->getTypeList();
|
||||||
|
return $list[$value] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getRecommendTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['recommend'] ?? '');
|
||||||
|
$list = $this->getRecommendList();
|
||||||
|
return $list[$value] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getReleaseTimeTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['release_time'] ?? '');
|
||||||
|
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setReleaseTimeAttr($value)
|
||||||
|
{
|
||||||
|
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -25,7 +25,10 @@ class News extends Model
|
|||||||
|
|
||||||
// 追加属性
|
// 追加属性
|
||||||
protected $append = [
|
protected $append = [
|
||||||
|
'type_text',
|
||||||
'recommend_text',
|
'recommend_text',
|
||||||
|
'hot_text',
|
||||||
|
'fine_text',
|
||||||
'release_time_text'
|
'release_time_text'
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -41,11 +44,34 @@ class News extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTypeList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Type 1'), '2' => __('Type 2')];
|
||||||
|
}
|
||||||
|
|
||||||
public function getRecommendList()
|
public function getRecommendList()
|
||||||
{
|
{
|
||||||
return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
|
return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getHotList()
|
||||||
|
{
|
||||||
|
return ['0' => __('Hot 0'), '1' => __('Hot 1')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFineList()
|
||||||
|
{
|
||||||
|
return ['0' => __('Fine 0'), '1' => __('Fine 1')];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTypeTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['type'] ?? '');
|
||||||
|
$list = $this->getTypeList();
|
||||||
|
return $list[$value] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getRecommendTextAttr($value, $data)
|
public function getRecommendTextAttr($value, $data)
|
||||||
{
|
{
|
||||||
@ -55,6 +81,22 @@ class News extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getHotTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['hot'] ?? '');
|
||||||
|
$list = $this->getHotList();
|
||||||
|
return $list[$value] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getFineTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['fine'] ?? '');
|
||||||
|
$list = $this->getFineList();
|
||||||
|
return $list[$value] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getReleaseTimeTextAttr($value, $data)
|
public function getReleaseTimeTextAttr($value, $data)
|
||||||
{
|
{
|
||||||
$value = $value ?: ($data['release_time'] ?? '');
|
$value = $value ?: ($data['release_time'] ?? '');
|
||||||
@ -69,6 +111,6 @@ class News extends Model
|
|||||||
|
|
||||||
public function cate()
|
public function cate()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(NewsCate::class, 'cate_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
return $this->belongsTo('app\admin\model\news\Cate', 'cate_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -25,6 +25,7 @@ class NewsCate extends Model
|
|||||||
|
|
||||||
// 追加属性
|
// 追加属性
|
||||||
protected $append = [
|
protected $append = [
|
||||||
|
'home_text',
|
||||||
'status_text',
|
'status_text',
|
||||||
'hot_text'
|
'hot_text'
|
||||||
];
|
];
|
||||||
@ -41,6 +42,11 @@ class NewsCate extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getHomeList()
|
||||||
|
{
|
||||||
|
return ['0' => __('Home 0'), '1' => __('Home 1')];
|
||||||
|
}
|
||||||
|
|
||||||
public function getStatusList()
|
public function getStatusList()
|
||||||
{
|
{
|
||||||
return ['1' => __('Status 1'), '2' => __('Status 2')];
|
return ['1' => __('Status 1'), '2' => __('Status 2')];
|
||||||
@ -52,6 +58,14 @@ class NewsCate extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getHomeTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['home'] ?? '');
|
||||||
|
$list = $this->getHomeList();
|
||||||
|
return $list[$value] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getStatusTextAttr($value, $data)
|
public function getStatusTextAttr($value, $data)
|
||||||
{
|
{
|
||||||
$value = $value ?: ($data['status'] ?? '');
|
$value = $value ?: ($data['status'] ?? '');
|
||||||
|
27
application/admin/validate/home/Encyclopedia.php
Normal file
27
application/admin/validate/home/Encyclopedia.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\validate\home;
|
||||||
|
|
||||||
|
use think\Validate;
|
||||||
|
|
||||||
|
class Encyclopedia extends Validate
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 验证规则
|
||||||
|
*/
|
||||||
|
protected $rule = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 提示消息
|
||||||
|
*/
|
||||||
|
protected $message = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 验证场景
|
||||||
|
*/
|
||||||
|
protected $scene = [
|
||||||
|
'add' => [],
|
||||||
|
'edit' => [],
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
27
application/admin/validate/home/Information.php
Normal file
27
application/admin/validate/home/Information.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\validate\home;
|
||||||
|
|
||||||
|
use think\Validate;
|
||||||
|
|
||||||
|
class Information extends Validate
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 验证规则
|
||||||
|
*/
|
||||||
|
protected $rule = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 提示消息
|
||||||
|
*/
|
||||||
|
protected $message = [
|
||||||
|
];
|
||||||
|
/**
|
||||||
|
* 验证场景
|
||||||
|
*/
|
||||||
|
protected $scene = [
|
||||||
|
'add' => [],
|
||||||
|
'edit' => [],
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
112
application/admin/view/home/encyclopedia/add.html
Normal file
112
application/admin/view/home/encyclopedia/add.html
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-title" class="form-control" name="row[title]" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Subtitle')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-subtitle" class="form-control" name="row[subtitle]" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Source')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-source" class="form-control" name="row[source]" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="form-group">-->
|
||||||
|
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>-->
|
||||||
|
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||||
|
<!-- <div class="input-group">-->
|
||||||
|
<!-- <input id="c-image" class="form-control" size="50" name="row[image]" type="text">-->
|
||||||
|
<!-- <div class="input-group-addon no-border no-padding">-->
|
||||||
|
<!-- <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>-->
|
||||||
|
<!-- <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <span class="msg-box n-right" for="c-image"></span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <ul class="row list-inline faupload-preview" id="p-image"></ul>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
|
||||||
|
{foreach name="typeList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="2"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group c_content">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('File')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-file" class="form-control" size="50" name="row[file]" type="text">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="faupload-file" class="btn btn-danger faupload" data-input-id="c-file" data-multiple="false" data-preview-id="p-file"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-file" class="btn btn-primary fachoose" data-input-id="c-file" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-file"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline faupload-preview" id="p-file"></ul>
|
||||||
|
<span class="c_pdf" style="color: red">( 请上传pdf文件 )</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Recommend')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-recommend" data-rule="required" class="form-control selectpicker" name="row[recommend]">
|
||||||
|
{foreach name="recommendList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="0">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Release_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-release_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[release_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="form-group">-->
|
||||||
|
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Views')}:</label>-->
|
||||||
|
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||||
|
<!-- <input id="c-views" class="form-control" name="row[views]" type="number" value="0">-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Virtual_views')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-virtual_views" class="form-control" name="row[virtual_views]" type="number" value="0">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
113
application/admin/view/home/encyclopedia/edit.html
Normal file
113
application/admin/view/home/encyclopedia/edit.html
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Subtitle')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-subtitle" class="form-control" name="row[subtitle]" type="text" value="{$row.subtitle|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Source')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-source" class="form-control" name="row[source]" type="text" value="{$row.source|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="form-group">-->
|
||||||
|
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>-->
|
||||||
|
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||||
|
<!-- <div class="input-group">-->
|
||||||
|
<!-- <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">-->
|
||||||
|
<!-- <div class="input-group-addon no-border no-padding">-->
|
||||||
|
<!-- <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>-->
|
||||||
|
<!-- <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <span class="msg-box n-right" for="c-image"></span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <ul class="row list-inline faupload-preview" id="p-image"></ul>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
|
||||||
|
{foreach name="typeList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group c_content">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('File')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-file" class="form-control" size="50" name="row[file]" type="text" value="{$row.file|htmlentities}">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="faupload-file" class="btn btn-danger faupload" data-input-id="c-file" data-multiple="false" data-preview-id="p-file"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-file" class="btn btn-primary fachoose" data-input-id="c-file" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-file"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline faupload-preview" id="p-file"></ul>
|
||||||
|
<span class="c_pdf" style="color: red">( 请上传pdf文件 )</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Recommend')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-recommend" data-rule="required" class="form-control selectpicker" name="row[recommend]">
|
||||||
|
{foreach name="recommendList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.recommend"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Release_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-release_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[release_time]" type="text" value="{:$row.release_time?datetime($row.release_time):''}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="form-group">-->
|
||||||
|
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Views')}:</label>-->
|
||||||
|
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||||
|
<!-- <input id="c-views" class="form-control" name="row[views]" type="number" value="{$row.views|htmlentities}">-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Virtual_views')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-virtual_views" class="form-control" name="row[virtual_views]" type="number" value="{$row.virtual_views|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
29
application/admin/view/home/encyclopedia/index.html
Normal file
29
application/admin/view/home/encyclopedia/index.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<div class="panel panel-default panel-intro">
|
||||||
|
{:build_heading()}
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<div id="myTabContent" class="tab-content">
|
||||||
|
<div class="tab-pane fade active in" id="one">
|
||||||
|
<div class="widget-body no-padding">
|
||||||
|
<div id="toolbar" class="toolbar">
|
||||||
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('home/encyclopedia/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('home/encyclopedia/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('home/encyclopedia/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('home/encyclopedia/recyclebin')?'':'hide'}" href="home/encyclopedia/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
|
||||||
|
</div>
|
||||||
|
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||||
|
data-operate-edit="{:$auth->check('home/encyclopedia/edit')}"
|
||||||
|
data-operate-del="{:$auth->check('home/encyclopedia/del')}"
|
||||||
|
width="100%">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
25
application/admin/view/home/encyclopedia/recyclebin.html
Normal file
25
application/admin/view/home/encyclopedia/recyclebin.html
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<div class="panel panel-default panel-intro">
|
||||||
|
{:build_heading()}
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<div id="myTabContent" class="tab-content">
|
||||||
|
<div class="tab-pane fade active in" id="one">
|
||||||
|
<div class="widget-body no-padding">
|
||||||
|
<div id="toolbar" class="toolbar">
|
||||||
|
{:build_toolbar('refresh')}
|
||||||
|
<a class="btn btn-info btn-multi btn-disabled disabled {:$auth->check('home/encyclopedia/restore')?'':'hide'}" href="javascript:;" data-url="home/encyclopedia/restore" data-action="restore"><i class="fa fa-rotate-left"></i> {:__('Restore')}</a>
|
||||||
|
<a class="btn btn-danger btn-multi btn-disabled disabled {:$auth->check('home/encyclopedia/destroy')?'':'hide'}" href="javascript:;" data-url="home/encyclopedia/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>
|
||||||
|
<a class="btn btn-success btn-restoreall {:$auth->check('home/encyclopedia/restore')?'':'hide'}" href="javascript:;" data-url="home/encyclopedia/restore" title="{:__('Restore all')}"><i class="fa fa-rotate-left"></i> {:__('Restore all')}</a>
|
||||||
|
<a class="btn btn-danger btn-destroyall {:$auth->check('home/encyclopedia/destroy')?'':'hide'}" href="javascript:;" data-url="home/encyclopedia/destroy" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>
|
||||||
|
</div>
|
||||||
|
<table id="table" class="table table-striped table-bordered table-hover"
|
||||||
|
data-operate-restore="{:$auth->check('home/encyclopedia/restore')}"
|
||||||
|
data-operate-destroy="{:$auth->check('home/encyclopedia/destroy')}"
|
||||||
|
width="100%">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
113
application/admin/view/home/information/add.html
Normal file
113
application/admin/view/home/information/add.html
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-title" class="form-control" name="row[title]" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Subtitle')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-subtitle" class="form-control" name="row[subtitle]" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Source')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-source" class="form-control" name="row[source]" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="form-group">-->
|
||||||
|
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>-->
|
||||||
|
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||||
|
<!-- <div class="input-group">-->
|
||||||
|
<!-- <input id="c-image" class="form-control" size="50" name="row[image]" type="text">-->
|
||||||
|
<!-- <div class="input-group-addon no-border no-padding">-->
|
||||||
|
<!-- <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>-->
|
||||||
|
<!-- <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <span class="msg-box n-right" for="c-image"></span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <ul class="row list-inline faupload-preview" id="p-image"></ul>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
|
||||||
|
{foreach name="typeList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="2"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group c_content">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('File')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-file" class="form-control" size="50" name="row[file]" type="text">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="faupload-file" class="btn btn-danger faupload" data-input-id="c-file" data-multiple="false" data-preview-id="p-file"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-file" class="btn btn-primary fachoose" data-input-id="c-file" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-file"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline faupload-preview" id="p-file"></ul>
|
||||||
|
<span class="c_pdf" style="color: red">( 请上传pdf文件 )</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Recommend')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-recommend" data-rule="required" class="form-control selectpicker" name="row[recommend]">
|
||||||
|
{foreach name="recommendList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="0">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Release_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-release_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[release_time]" type="text" value="{:date('Y-m-d H:i:s')}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="form-group">-->
|
||||||
|
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Views')}:</label>-->
|
||||||
|
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||||
|
<!-- <input id="c-views" class="form-control" name="row[views]" type="number" value="0">-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Virtual_views')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-virtual_views" class="form-control" name="row[virtual_views]" type="number" value="0">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
113
application/admin/view/home/information/edit.html
Normal file
113
application/admin/view/home/information/edit.html
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Subtitle')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-subtitle" class="form-control" name="row[subtitle]" type="text" value="{$row.subtitle|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Source')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-source" class="form-control" name="row[source]" type="text" value="{$row.source|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="form-group">-->
|
||||||
|
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>-->
|
||||||
|
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||||
|
<!-- <div class="input-group">-->
|
||||||
|
<!-- <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">-->
|
||||||
|
<!-- <div class="input-group-addon no-border no-padding">-->
|
||||||
|
<!-- <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>-->
|
||||||
|
<!-- <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <span class="msg-box n-right" for="c-image"></span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <ul class="row list-inline faupload-preview" id="p-image"></ul>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
|
||||||
|
{foreach name="typeList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group c_content">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('File')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-file" class="form-control" size="50" name="row[file]" type="text" value="{$row.file|htmlentities}">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="faupload-file" class="btn btn-danger faupload" data-input-id="c-file" data-multiple="false" data-preview-id="p-file"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-file" class="btn btn-primary fachoose" data-input-id="c-file" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-file"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline faupload-preview" id="p-file"></ul>
|
||||||
|
<span class="c_pdf" style="color: red">( 请上传pdf文件 )</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Recommend')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-recommend" data-rule="required" class="form-control selectpicker" name="row[recommend]">
|
||||||
|
{foreach name="recommendList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.recommend"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-weigh" class="form-control" name="row[weigh]" type="number" value="{$row.weigh|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Release_time')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-release_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[release_time]" type="text" value="{:$row.release_time?datetime($row.release_time):''}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div class="form-group">-->
|
||||||
|
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Views')}:</label>-->
|
||||||
|
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||||
|
<!-- <input id="c-views" class="form-control" name="row[views]" type="number" value="{$row.views|htmlentities}">-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Virtual_views')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-virtual_views" class="form-control" name="row[virtual_views]" type="number" value="{$row.virtual_views|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="form-group layer-footer">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</form>
|
29
application/admin/view/home/information/index.html
Normal file
29
application/admin/view/home/information/index.html
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<div class="panel panel-default panel-intro">
|
||||||
|
{:build_heading()}
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<div id="myTabContent" class="tab-content">
|
||||||
|
<div class="tab-pane fade active in" id="one">
|
||||||
|
<div class="widget-body no-padding">
|
||||||
|
<div id="toolbar" class="toolbar">
|
||||||
|
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('home/information/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('home/information/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||||
|
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('home/information/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<a class="btn btn-success btn-recyclebin btn-dialog {:$auth->check('home/information/recyclebin')?'':'hide'}" href="home/information/recyclebin" title="{:__('Recycle bin')}"><i class="fa fa-recycle"></i> {:__('Recycle bin')}</a>
|
||||||
|
</div>
|
||||||
|
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||||
|
data-operate-edit="{:$auth->check('home/information/edit')}"
|
||||||
|
data-operate-del="{:$auth->check('home/information/del')}"
|
||||||
|
width="100%">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
25
application/admin/view/home/information/recyclebin.html
Normal file
25
application/admin/view/home/information/recyclebin.html
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<div class="panel panel-default panel-intro">
|
||||||
|
{:build_heading()}
|
||||||
|
|
||||||
|
<div class="panel-body">
|
||||||
|
<div id="myTabContent" class="tab-content">
|
||||||
|
<div class="tab-pane fade active in" id="one">
|
||||||
|
<div class="widget-body no-padding">
|
||||||
|
<div id="toolbar" class="toolbar">
|
||||||
|
{:build_toolbar('refresh')}
|
||||||
|
<a class="btn btn-info btn-multi btn-disabled disabled {:$auth->check('home/information/restore')?'':'hide'}" href="javascript:;" data-url="home/information/restore" data-action="restore"><i class="fa fa-rotate-left"></i> {:__('Restore')}</a>
|
||||||
|
<a class="btn btn-danger btn-multi btn-disabled disabled {:$auth->check('home/information/destroy')?'':'hide'}" href="javascript:;" data-url="home/information/destroy" data-action="destroy"><i class="fa fa-times"></i> {:__('Destroy')}</a>
|
||||||
|
<a class="btn btn-success btn-restoreall {:$auth->check('home/information/restore')?'':'hide'}" href="javascript:;" data-url="home/information/restore" title="{:__('Restore all')}"><i class="fa fa-rotate-left"></i> {:__('Restore all')}</a>
|
||||||
|
<a class="btn btn-danger btn-destroyall {:$auth->check('home/information/destroy')?'':'hide'}" href="javascript:;" data-url="home/information/destroy" title="{:__('Destroy all')}"><i class="fa fa-times"></i> {:__('Destroy all')}</a>
|
||||||
|
</div>
|
||||||
|
<table id="table" class="table table-striped table-bordered table-hover"
|
||||||
|
data-operate-restore="{:$auth->check('home/information/restore')}"
|
||||||
|
data-operate-destroy="{:$auth->check('home/information/destroy')}"
|
||||||
|
width="100%">
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -6,6 +6,12 @@
|
|||||||
<input id="c-cate_id" data-rule="required" data-source="home/news_cate/index" class="form-control selectpage" name="row[cate_id]" type="text" value="">
|
<input id="c-cate_id" data-rule="required" data-source="home/news_cate/index" class="form-control selectpage" name="row[cate_id]" type="text" value="">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div class="form-group">-->
|
||||||
|
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>-->
|
||||||
|
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||||
|
<!-- <input id="c-flag" class="form-control" name="row[flag]" type="text">-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
@ -19,30 +25,64 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Source')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<div class="input-group">
|
<input id="c-source" class="form-control" name="row[source]" type="text">
|
||||||
<input id="c-image" class="form-control" size="50" name="row[image]" type="text">
|
|
||||||
<div class="input-group-addon no-border no-padding">
|
|
||||||
<span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
|
||||||
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
|
||||||
</div>
|
|
||||||
<span class="msg-box n-right" for="c-image"></span>
|
|
||||||
</div>
|
|
||||||
<ul class="row list-inline faupload-preview" id="p-image"></ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div class="form-group">-->
|
||||||
|
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>-->
|
||||||
|
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||||
|
<!-- <div class="input-group">-->
|
||||||
|
<!-- <input id="c-image" class="form-control" size="50" name="row[image]" type="text">-->
|
||||||
|
<!-- <div class="input-group-addon no-border no-padding">-->
|
||||||
|
<!-- <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>-->
|
||||||
|
<!-- <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <span class="msg-box n-right" for="c-image"></span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <ul class="row list-inline faupload-preview" id="p-image"></ul>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
|
||||||
|
{foreach name="typeList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group c_content">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
|
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('File')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-file" class="form-control" size="50" name="row[file]" type="text">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="faupload-file" class="btn btn-danger faupload" data-input-id="c-file" data-multiple="false" data-preview-id="p-file"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-file" class="btn btn-primary fachoose" data-input-id="c-file" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-file"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline faupload-preview" id="p-file"></ul>
|
||||||
|
|
||||||
|
<span class="c_pdf" style="color: red">( 请上传pdf文件 )</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Recommend')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Recommend')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
<select id="c-recommend" class="form-control selectpicker" name="row[recommend]">
|
<select id="c-recommend" data-rule="required" class="form-control selectpicker" name="row[recommend]">
|
||||||
{foreach name="recommendList" item="vo"}
|
{foreach name="recommendList" item="vo"}
|
||||||
<option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
|
<option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
@ -50,6 +90,30 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Hot')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-hot" data-rule="required" class="form-control selectpicker" name="row[hot]">
|
||||||
|
{foreach name="hotList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Fine')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-fine" data-rule="required" class="form-control selectpicker" name="row[fine]">
|
||||||
|
{foreach name="fineList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
@ -68,6 +132,12 @@
|
|||||||
<!-- <input id="c-views" class="form-control" name="row[views]" type="number" value="0">-->
|
<!-- <input id="c-views" class="form-control" name="row[views]" type="number" value="0">-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Virtual_views')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-virtual_views" class="form-control" name="row[virtual_views]" type="number" value="0">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group layer-footer">
|
<div class="form-group layer-footer">
|
||||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
@ -6,6 +6,12 @@
|
|||||||
<input id="c-cate_id" data-rule="required" data-source="home/news_cate/index" class="form-control selectpage" name="row[cate_id]" type="text" value="{$row.cate_id|htmlentities}">
|
<input id="c-cate_id" data-rule="required" data-source="home/news_cate/index" class="form-control selectpage" name="row[cate_id]" type="text" value="{$row.cate_id|htmlentities}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div class="form-group">-->
|
||||||
|
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>-->
|
||||||
|
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||||
|
<!-- <input id="c-flag" class="form-control" name="row[flag]" type="text" value="{$row.flag|htmlentities}">-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
@ -19,30 +25,63 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Source')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<div class="input-group">
|
<input id="c-source" class="form-control" name="row[source]" type="text" value="{$row.source|htmlentities}">
|
||||||
<input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">
|
|
||||||
<div class="input-group-addon no-border no-padding">
|
|
||||||
<span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
|
||||||
<span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
|
||||||
</div>
|
|
||||||
<span class="msg-box n-right" for="c-image"></span>
|
|
||||||
</div>
|
|
||||||
<ul class="row list-inline faupload-preview" id="p-image"></ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- <div class="form-group">-->
|
||||||
|
<!-- <label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>-->
|
||||||
|
<!-- <div class="col-xs-12 col-sm-8">-->
|
||||||
|
<!-- <div class="input-group">-->
|
||||||
|
<!-- <input id="c-image" class="form-control" size="50" name="row[image]" type="text" value="{$row.image|htmlentities}">-->
|
||||||
|
<!-- <div class="input-group-addon no-border no-padding">-->
|
||||||
|
<!-- <span><button type="button" id="faupload-image" class="btn btn-danger faupload" data-input-id="c-image" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp,image/webp" data-multiple="false" data-preview-id="p-image"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>-->
|
||||||
|
<!-- <span><button type="button" id="fachoose-image" class="btn btn-primary fachoose" data-input-id="c-image" data-mimetype="image/*" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <span class="msg-box n-right" for="c-image"></span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <ul class="row list-inline faupload-preview" id="p-image"></ul>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </div>-->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
|
||||||
|
{foreach name="typeList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group c_content" >
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('File')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<div class="input-group">
|
||||||
|
<input id="c-file" class="form-control" size="50" name="row[file]" type="text" value="{$row.file|htmlentities}">
|
||||||
|
<div class="input-group-addon no-border no-padding">
|
||||||
|
<span><button type="button" id="faupload-file" class="btn btn-danger faupload" data-input-id="c-file" data-multiple="false" data-preview-id="p-file"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
|
||||||
|
<span><button type="button" id="fachoose-file" class="btn btn-primary fachoose" data-input-id="c-file" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
|
||||||
|
</div>
|
||||||
|
<span class="msg-box n-right" for="c-file"></span>
|
||||||
|
</div>
|
||||||
|
<ul class="row list-inline faupload-preview" id="p-file"></ul>
|
||||||
|
<span class="c_pdf" style="color: red">( 请上传pdf文件 )</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Recommend')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Recommend')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
<select id="c-recommend" class="form-control selectpicker" name="row[recommend]">
|
<select id="c-recommend" data-rule="required" class="form-control selectpicker" name="row[recommend]">
|
||||||
{foreach name="recommendList" item="vo"}
|
{foreach name="recommendList" item="vo"}
|
||||||
<option value="{$key}" {in name="key" value="$row.recommend"}selected{/in}>{$vo}</option>
|
<option value="{$key}" {in name="key" value="$row.recommend"}selected{/in}>{$vo}</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
@ -50,6 +89,30 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Hot')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-hot" data-rule="required" class="form-control selectpicker" name="row[hot]">
|
||||||
|
{foreach name="hotList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.hot"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Fine')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-fine" data-rule="required" class="form-control selectpicker" name="row[fine]">
|
||||||
|
{foreach name="fineList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.fine"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
@ -68,6 +131,12 @@
|
|||||||
<!-- <input id="c-views" class="form-control" name="row[views]" type="number" value="{$row.views|htmlentities}">-->
|
<!-- <input id="c-views" class="form-control" name="row[views]" type="number" value="{$row.views|htmlentities}">-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Virtual_views')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-virtual_views" class="form-control" name="row[virtual_views]" type="number" value="{$row.virtual_views|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group layer-footer">
|
<div class="form-group layer-footer">
|
||||||
<label class="control-label col-xs-12 col-sm-2"></label>
|
<label class="control-label col-xs-12 col-sm-2"></label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
@ -20,6 +20,24 @@
|
|||||||
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
|
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-flag" class="form-control" name="row[flag]" type="text">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Home')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-home" data-rule="required" class="form-control selectpicker" name="row[home]">
|
||||||
|
{foreach name="homeList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
@ -20,6 +20,24 @@
|
|||||||
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
|
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Flag')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
<input id="c-flag" class="form-control" name="row[flag]" type="text" value="{$row.flag|htmlentities}">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="control-label col-xs-12 col-sm-2">{:__('Home')}:</label>
|
||||||
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
|
||||||
|
<select id="c-home" data-rule="required" class="form-control selectpicker" name="row[home]">
|
||||||
|
{foreach name="homeList" item="vo"}
|
||||||
|
<option value="{$key}" {in name="key" value="$row.home"}selected{/in}>{$vo}</option>
|
||||||
|
{/foreach}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
|
||||||
<div class="col-xs-12 col-sm-8">
|
<div class="col-xs-12 col-sm-8">
|
||||||
|
@ -3,26 +3,27 @@
|
|||||||
namespace app\api\controller\home;
|
namespace app\api\controller\home;
|
||||||
|
|
||||||
|
|
||||||
use app\common\model\home\RecruitmentInformation as RecruitmentInformationModel;
|
use app\common\model\home\Encyclopedia as EncyclopediaModel;
|
||||||
use app\common\model\home\RecruitmentInformationCate;
|
use app\common\model\home\News as NewsModel;
|
||||||
|
use app\common\model\home\NewsCate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 招聘信息接口
|
* 团务百科接口
|
||||||
*/
|
*/
|
||||||
class RecruitmentInformation extends Base
|
class Encyclopedia extends Base
|
||||||
{
|
{
|
||||||
protected $noNeedLogin = ['*'];
|
protected $noNeedLogin = ['*'];
|
||||||
protected $noNeedRight = ['*'];
|
protected $noNeedRight = ['*'];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @var \app\common\model\home\RecruitmentInformation
|
* @var \app\common\model\home\Encyclopedia
|
||||||
*/
|
*/
|
||||||
protected $model = null;
|
protected $model = null;
|
||||||
|
|
||||||
public function _initialize()
|
public function _initialize()
|
||||||
{
|
{
|
||||||
parent::_initialize();
|
parent::_initialize();
|
||||||
$this->model = new RecruitmentInformationModel;
|
$this->model = new EncyclopediaModel;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -30,14 +31,13 @@ class RecruitmentInformation extends Base
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ApiTitle( 招聘信息列表)
|
* @ApiTitle( 团务百科文章列表)
|
||||||
* @ApiSummary(招聘信息列表)
|
* @ApiSummary(团务百科文章列表)
|
||||||
* @ApiMethod(GET)
|
* @ApiMethod(GET)
|
||||||
* @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
|
* @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
|
||||||
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
|
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
|
||||||
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
||||||
* @ApiParams(name = "recommend", type = "string",required=false,description = "置顶:0=否,1=是")
|
* @ApiParams(name = "recommend", type = "string",required=false,description = "置顶:0=否,1=是")
|
||||||
* @ApiParams(name = "cate_id", type = "int",required=false,description = "职位分类id")
|
|
||||||
* @ApiReturn({
|
* @ApiReturn({
|
||||||
*
|
*
|
||||||
*})
|
*})
|
||||||
@ -51,8 +51,11 @@ class RecruitmentInformation extends Base
|
|||||||
$limit = $this->request->get('limit/d', 0); //条数
|
$limit = $this->request->get('limit/d', 0); //条数
|
||||||
$keywords = $this->request->get('keywords/s', ''); //搜索关键字
|
$keywords = $this->request->get('keywords/s', ''); //搜索关键字
|
||||||
$recommend = $this->request->get('recommend/s', ''); //搜索关键字
|
$recommend = $this->request->get('recommend/s', ''); //搜索关键字
|
||||||
// $params =[];
|
$params =[];
|
||||||
$cate_id = $this->request->get('cate_id/s', ''); //搜索关键字
|
$cate_id = $this->request->get('cate_id/s', ''); //搜索关键字
|
||||||
|
// $params["flag"] = $this->request->get('flag/s', ''); //搜索关键字
|
||||||
|
// $params["hot"] = $this->request->get('hot/s', ''); //搜索关键字
|
||||||
|
// $params["fine"] = $this->request->get('fine/s', ''); //搜索关键字
|
||||||
|
|
||||||
|
|
||||||
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
||||||
@ -60,7 +63,7 @@ class RecruitmentInformation extends Base
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
//当前申请状态
|
//当前申请状态
|
||||||
$res = $this->model::allList($page, $limit,$keywords,$recommend,$cate_id,[]);
|
$res = $this->model::allList($page, $limit,$keywords,$recommend,$cate_id,$params);
|
||||||
// var_dump($this->model->getLastSql());
|
// var_dump($this->model->getLastSql());
|
||||||
}catch (\Exception $e){
|
}catch (\Exception $e){
|
||||||
|
|
||||||
@ -73,33 +76,26 @@ class RecruitmentInformation extends Base
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ApiTitle( 招聘信息分类)
|
* 查看团务百科文章详情
|
||||||
* @ApiSummary(招聘信息分类)
|
|
||||||
* @ApiMethod(GET)
|
|
||||||
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
|
|
||||||
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
|
||||||
* @ApiReturn({
|
|
||||||
*
|
*
|
||||||
*})
|
* @ApiMethod (GET)
|
||||||
|
* @ApiParams (name="id", type="string", required=true, description="ID")
|
||||||
*/
|
*/
|
||||||
public function cate()
|
public function detail()
|
||||||
{
|
{
|
||||||
$user_id = 0;
|
$user_id = 0;
|
||||||
$user = $this->auth->getUser();//登录用户
|
$user = $this->auth->getUser();//登录用户
|
||||||
if($user)$user_id = $user['id'];
|
if($user)$user_id = $user['id'];
|
||||||
|
$id = $this->request->get('id/d');
|
||||||
$page = $this->request->get('page/d', 0); //页数
|
|
||||||
$limit = $this->request->get('limit/d', 0); //条数
|
|
||||||
|
|
||||||
|
|
||||||
try{
|
try{
|
||||||
//当前申请状态
|
$menulist = $this->model->detail($id,$show_field=[],$except_field=[],$user_id);
|
||||||
$res = RecruitmentInformationCate::allList($page, $limit);
|
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
$this->success('查询成功', $res);
|
|
||||||
|
$this->success('查询成功', $menulist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
100
application/api/controller/home/Information.php
Normal file
100
application/api/controller/home/Information.php
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\api\controller\home;
|
||||||
|
|
||||||
|
|
||||||
|
use app\common\model\home\Information as InformationModel;
|
||||||
|
use app\common\model\home\NewsCate;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 信息公开接口
|
||||||
|
*/
|
||||||
|
class Information extends Base
|
||||||
|
{
|
||||||
|
protected $noNeedLogin = ['*'];
|
||||||
|
protected $noNeedRight = ['*'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @var \app\common\model\home\Information
|
||||||
|
*/
|
||||||
|
protected $model = null;
|
||||||
|
|
||||||
|
public function _initialize()
|
||||||
|
{
|
||||||
|
parent::_initialize();
|
||||||
|
$this->model = new InformationModel;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ApiTitle( 信息公开文章列表)
|
||||||
|
* @ApiSummary(信息公开文章列表)
|
||||||
|
* @ApiMethod(GET)
|
||||||
|
* @ApiParams(name = "keywords", type = "string",required=false,description = "搜索关键字")
|
||||||
|
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
|
||||||
|
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
||||||
|
* @ApiParams(name = "recommend", type = "string",required=false,description = "置顶:0=否,1=是")
|
||||||
|
* @ApiReturn({
|
||||||
|
*
|
||||||
|
*})
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$user_id = 0;
|
||||||
|
$user = $this->auth->getUser();//登录用户
|
||||||
|
if($user)$user_id = $user['id'];
|
||||||
|
$page = $this->request->get('page/d', 0); //页数
|
||||||
|
$limit = $this->request->get('limit/d', 0); //条数
|
||||||
|
$keywords = $this->request->get('keywords/s', ''); //搜索关键字
|
||||||
|
$recommend = $this->request->get('recommend/s', ''); //搜索关键字
|
||||||
|
$params =[];
|
||||||
|
$cate_id = $this->request->get('cate_id/s', ''); //搜索关键字
|
||||||
|
// $params["flag"] = $this->request->get('flag/s', ''); //搜索关键字
|
||||||
|
// $params["hot"] = $this->request->get('hot/s', ''); //搜索关键字
|
||||||
|
// $params["fine"] = $this->request->get('fine/s', ''); //搜索关键字
|
||||||
|
|
||||||
|
|
||||||
|
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
||||||
|
|
||||||
|
|
||||||
|
try{
|
||||||
|
//当前申请状态
|
||||||
|
$res = $this->model::allList($page, $limit,$keywords,$recommend,$cate_id,$params);
|
||||||
|
// var_dump($this->model->getLastSql());
|
||||||
|
}catch (\Exception $e){
|
||||||
|
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
$this->success('查询成功', $res);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查看信息公开文章详情
|
||||||
|
*
|
||||||
|
* @ApiMethod (GET)
|
||||||
|
* @ApiParams (name="id", type="string", required=true, description="ID")
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
$user_id = 0;
|
||||||
|
$user = $this->auth->getUser();//登录用户
|
||||||
|
if($user)$user_id = $user['id'];
|
||||||
|
$id = $this->request->get('id/d');
|
||||||
|
|
||||||
|
try{
|
||||||
|
$menulist = $this->model->detail($id,$show_field=[],$except_field=[],$user_id);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->error($e->getMessage());
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->success('查询成功', $menulist);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -1,65 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace app\api\controller\home;
|
|
||||||
|
|
||||||
use app\common\model\home\LeaveWord as LeaveWordModel;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 网站留言
|
|
||||||
*/
|
|
||||||
class LeaveWord extends Base
|
|
||||||
{
|
|
||||||
protected $noNeedLogin = ['*'];
|
|
||||||
protected $noNeedRight = ['*'];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @var \app\common\model\home\LeaveWord
|
|
||||||
*/
|
|
||||||
protected $model = null;
|
|
||||||
|
|
||||||
public function _initialize()
|
|
||||||
{
|
|
||||||
parent::_initialize();
|
|
||||||
$this->model = new LeaveWordModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ApiTitle( 发网站留言)
|
|
||||||
* @ApiSummary(发网站留言)
|
|
||||||
* @ApiMethod(POST)
|
|
||||||
* @ApiParams(name = "name", type = "string",required=false,description = "提交者姓名")
|
|
||||||
* @ApiParams(name = "mobile", type = "string",required=true,description = "联系电话")
|
|
||||||
* @ApiParams(name = "emil", type = "string",required=true,description = "邮箱地址")
|
|
||||||
* @ApiParams(name = "message", type = "string",required=false,description = "留言内容")
|
|
||||||
* @ApiReturn({
|
|
||||||
*
|
|
||||||
*})
|
|
||||||
*/
|
|
||||||
public function add()
|
|
||||||
{
|
|
||||||
$user_id = 0;
|
|
||||||
$user = $this->auth->getUser();//登录用户
|
|
||||||
if($user)$user_id = $user['id'];
|
|
||||||
$params=[];
|
|
||||||
$params["name"] = $this->request->post('name/s', ''); //页数
|
|
||||||
$params["mobile"] = $this->request->post('mobile/s', ''); //条数
|
|
||||||
$params["emil"] = $this->request->post('emil/s', ''); //搜索关键字
|
|
||||||
$params["message"] = $this->request->post('message/s', ''); //搜索关键字
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
try{
|
|
||||||
//当前申请状态
|
|
||||||
$res = $this->model->add($params,true);
|
|
||||||
// var_dump($this->model->getLastSql());
|
|
||||||
}catch (\Exception $e){
|
|
||||||
|
|
||||||
$this->error($e->getMessage());
|
|
||||||
}
|
|
||||||
$this->success('添加成功', $res);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
@ -38,6 +38,8 @@ class News extends Base
|
|||||||
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
||||||
* @ApiParams(name = "recommend", type = "string",required=false,description = "置顶:0=否,1=是")
|
* @ApiParams(name = "recommend", type = "string",required=false,description = "置顶:0=否,1=是")
|
||||||
* @ApiParams(name = "cate_id", type = "int",required=false,description = "新闻类目id")
|
* @ApiParams(name = "cate_id", type = "int",required=false,description = "新闻类目id")
|
||||||
|
* @ApiParams(name = "hot", type = "string",required=false,description = "热门:0=否,1=是")
|
||||||
|
* @ApiParams(name = "fine", type = "string",required=false,description = "精选:0=否,1=是")
|
||||||
* @ApiReturn({
|
* @ApiReturn({
|
||||||
*
|
*
|
||||||
*})
|
*})
|
||||||
@ -51,8 +53,11 @@ class News extends Base
|
|||||||
$limit = $this->request->get('limit/d', 0); //条数
|
$limit = $this->request->get('limit/d', 0); //条数
|
||||||
$keywords = $this->request->get('keywords/s', ''); //搜索关键字
|
$keywords = $this->request->get('keywords/s', ''); //搜索关键字
|
||||||
$recommend = $this->request->get('recommend/s', ''); //搜索关键字
|
$recommend = $this->request->get('recommend/s', ''); //搜索关键字
|
||||||
// $params =[];
|
$params =[];
|
||||||
$cate_id = $this->request->get('cate_id/s', ''); //搜索关键字
|
$cate_id = $this->request->get('cate_id/s', ''); //搜索关键字
|
||||||
|
$params["flag"] = $this->request->get('flag/s', ''); //搜索关键字
|
||||||
|
$params["hot"] = $this->request->get('hot/s', ''); //搜索关键字
|
||||||
|
$params["fine"] = $this->request->get('fine/s', ''); //搜索关键字
|
||||||
|
|
||||||
|
|
||||||
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
// $type = $this->request->get('type/s', ''); //筛选学员和教练单
|
||||||
@ -60,7 +65,7 @@ class News extends Base
|
|||||||
|
|
||||||
try{
|
try{
|
||||||
//当前申请状态
|
//当前申请状态
|
||||||
$res = $this->model::allList($page, $limit,$keywords,$recommend,$cate_id,[]);
|
$res = $this->model::allList($page, $limit,$keywords,$recommend,$cate_id,$params);
|
||||||
// var_dump($this->model->getLastSql());
|
// var_dump($this->model->getLastSql());
|
||||||
}catch (\Exception $e){
|
}catch (\Exception $e){
|
||||||
|
|
||||||
@ -78,6 +83,9 @@ class News extends Base
|
|||||||
* @ApiMethod(GET)
|
* @ApiMethod(GET)
|
||||||
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
|
* @ApiParams(name = "page", type = "string",required=true,description = "页数")
|
||||||
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
* @ApiParams(name = "limit", type = "string",required=true,description = "条数")
|
||||||
|
* @ApiParams(name = "hot", type = "string",required=false,description = "热门:0=否,1=是")
|
||||||
|
* @ApiParams(name = "home", type = "string",required=false,description = "首页:0=否,1=是")
|
||||||
|
* @ApiParams(name = "flag", type = "string",required=false,description = "分类标识")
|
||||||
* @ApiReturn({
|
* @ApiReturn({
|
||||||
*
|
*
|
||||||
*})
|
*})
|
||||||
@ -87,14 +95,17 @@ class News extends Base
|
|||||||
$user_id = 0;
|
$user_id = 0;
|
||||||
$user = $this->auth->getUser();//登录用户
|
$user = $this->auth->getUser();//登录用户
|
||||||
if($user)$user_id = $user['id'];
|
if($user)$user_id = $user['id'];
|
||||||
|
$params=[];
|
||||||
$page = $this->request->get('page/d', 0); //页数
|
$page = $this->request->get('page/d', 0); //页数
|
||||||
$limit = $this->request->get('limit/d', 0); //条数
|
$limit = $this->request->get('limit/d', 0); //条数
|
||||||
|
|
||||||
|
$params["flag"] = $this->request->get('flag/s', ''); //搜索关键字
|
||||||
|
$params["hot"] = $this->request->get('hot/s', ''); //搜索关键字
|
||||||
|
$params["home"] = $this->request->get('home/s', ''); //搜索关键字
|
||||||
|
|
||||||
try{
|
try{
|
||||||
//当前申请状态
|
//当前申请状态
|
||||||
$res = NewsCate::allList($page, $limit);
|
$res = NewsCate::allList($page, $limit,$params);
|
||||||
|
|
||||||
}catch (\Exception $e){
|
}catch (\Exception $e){
|
||||||
|
|
||||||
@ -112,17 +123,17 @@ class News extends Base
|
|||||||
*/
|
*/
|
||||||
public function detail()
|
public function detail()
|
||||||
{
|
{
|
||||||
$admin_id = $this->auth->id;
|
$user_id = 0;
|
||||||
|
$user = $this->auth->getUser();//登录用户
|
||||||
|
if($user)$user_id = $user['id'];
|
||||||
$id = $this->request->get('id/d');
|
$id = $this->request->get('id/d');
|
||||||
|
|
||||||
try{
|
try{
|
||||||
$menulist = $this->model->detail($id,$show_field=[],$except_field=[]);
|
$menulist = $this->model->detail($id,$show_field=[],$except_field=[],$user_id);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
$this->error($e->getMessage());
|
$this->error($e->getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$this->success('查询成功', $menulist);
|
$this->success('查询成功', $menulist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
276
application/common/model/home/Encyclopedia.php
Normal file
276
application/common/model/home/Encyclopedia.php
Normal file
@ -0,0 +1,276 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\common\model\home;
|
||||||
|
|
||||||
|
use app\common\model\Attachment;
|
||||||
|
use think\Model;
|
||||||
|
use traits\model\SoftDelete;
|
||||||
|
|
||||||
|
class Encyclopedia extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
use SoftDelete;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $name = 'encyclopedia';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = 'integer';
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = 'createtime';
|
||||||
|
protected $updateTime = 'updatetime';
|
||||||
|
protected $deleteTime = 'deletetime';
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
'type_text',
|
||||||
|
'recommend_text',
|
||||||
|
'release_time_text'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
protected static function init()
|
||||||
|
{
|
||||||
|
self::afterInsert(function ($row) {
|
||||||
|
if (!$row['weigh']) {
|
||||||
|
$pk = $row->getPk();
|
||||||
|
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTypeList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Type 1'), '2' => __('Type 2')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRecommendList()
|
||||||
|
{
|
||||||
|
return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTypeTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['type'] ?? '');
|
||||||
|
$list = $this->getTypeList();
|
||||||
|
return $list[$value] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getRecommendTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['recommend'] ?? '');
|
||||||
|
$list = $this->getRecommendList();
|
||||||
|
return $list[$value] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getReleaseTimeTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['release_time'] ?? '');
|
||||||
|
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setReleaseTimeAttr($value)
|
||||||
|
{
|
||||||
|
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getImageAttr($value, $data)
|
||||||
|
{
|
||||||
|
if (!empty($value)) return cdnurl($value, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function attachment()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Attachment::class, 'file', 'url', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**得到基础条件
|
||||||
|
* @param $status
|
||||||
|
* @param null $model
|
||||||
|
* @param string $alisa
|
||||||
|
*/
|
||||||
|
public static function getBaseWhere($whereData = [], $model = null, $alisa = '',$with = false)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!$model) {
|
||||||
|
$model = new static;
|
||||||
|
if ($alisa&&!$with) $model = $model->alias($alisa);
|
||||||
|
}
|
||||||
|
if ($alisa) $alisa = $alisa . '.';
|
||||||
|
$tableFields = (new static)->getTableFields();
|
||||||
|
foreach ($tableFields as $fields)
|
||||||
|
{
|
||||||
|
if(in_array($fields, ['cate_id',"recommend","hot","fine"]))continue;
|
||||||
|
// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||||
|
|
||||||
|
if (isset($whereData[$fields]) && $whereData[$fields]){
|
||||||
|
if(is_array($whereData[$fields])){
|
||||||
|
$model = $model->where("{$alisa}{$fields}", $whereData[$fields][0], $whereData[$fields][1]);
|
||||||
|
}else{
|
||||||
|
$model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (isset($whereData['hot']) && $whereData['hot']!=="" && $whereData['hot']!==null){
|
||||||
|
// $model = $model->where("{$alisa}hot", 'in', $whereData['hot'] );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isset($whereData['fine']) && $whereData['fine']!=="" && $whereData['fine']!==null){
|
||||||
|
// $model = $model->where("{$alisa}fine", 'in', $whereData['fine'] );
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($whereData['recommend']) && $whereData['recommend']!=="" && $whereData['recommend']!==null){
|
||||||
|
$model = $model->where("{$alisa}recommend", '=', $whereData['recommend'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($whereData['keywords'])&&$whereData['keywords']){
|
||||||
|
$model = $model->where("{$alisa}title|{$alisa}subtitle", 'LIKE', "%{$whereData['keywords']}%" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($whereData['cate_id'])&&$whereData['cate_id']){
|
||||||
|
$model = $model->where("{$alisa}cate_id", 'in', $whereData['cate_id'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($whereData['time'])&&$whereData['time']){
|
||||||
|
|
||||||
|
$model = $model->time(["{$alisa}release_time",$whereData['time']]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (isset($whereData['has_evaluate'])&&$whereData['has_evaluate']){
|
||||||
|
// //1查已评价 2查未评价
|
||||||
|
// if($whereData['has_evaluate'] == 1){
|
||||||
|
// //1查已评价
|
||||||
|
// $model = $model->where("{$alisa}classes_evaluate_id", '<>', 0);
|
||||||
|
// }else{
|
||||||
|
// //2查未评价
|
||||||
|
// $model = $model->whereExists(function ($query) use ($alisa) {
|
||||||
|
// $order_table_name = (new \app\common\model\school\classes\hourorder\Order())->getQuery()->getTable();
|
||||||
|
// $query->table($order_table_name)->where($order_table_name . '.classes_order_id=' . $alisa . 'id')->where('status', '=', '3');
|
||||||
|
// })->where("{$alisa}classes_evaluate_id", '=', 0);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
return $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static function allList($page, $limit,$keywords,$recommend="",$cate_id=[],$params=[]){
|
||||||
|
$with_field = [
|
||||||
|
'attachment'=>['*'],
|
||||||
|
'base'=>['*'],
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
$alisa = (new self)->getWithAlisaName();
|
||||||
|
$sort = " {$alisa}.recommend desc,{$alisa}.weigh desc,{$alisa}.id desc";
|
||||||
|
|
||||||
|
|
||||||
|
// $sort = " recommend desc,weigh desc,id desc";
|
||||||
|
$serch_where = ['recommend'=>$recommend,'cate_id'=>$cate_id,'keywords'=>$keywords];
|
||||||
|
|
||||||
|
return (new self)->getBaseList(array_merge($serch_where,$params), $page, $limit,$sort,$with_field);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 通用详情(后台api版本)
|
||||||
|
* @param $params
|
||||||
|
* @param $trans
|
||||||
|
* @return $this
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function detail($id,$show_field=[],$except_field=[],$user_id=0,$oper_type='user',$trans=false){
|
||||||
|
$row = $this->get($id);
|
||||||
|
if (!$row) {
|
||||||
|
throw new \Exception(__('No Results were found'));
|
||||||
|
}
|
||||||
|
|
||||||
|
//上一篇,下一篇
|
||||||
|
$prev = $this->where('id', '<', $row['id'])->order('id', 'desc')->find();
|
||||||
|
$next = $this->where('id', '>', $row['id'])->order('id', 'asc')->find();
|
||||||
|
|
||||||
|
if($show_field){
|
||||||
|
$row->visible($show_field);
|
||||||
|
}
|
||||||
|
if($except_field){
|
||||||
|
$row->hidden($except_field);
|
||||||
|
}
|
||||||
|
$row->attachment;
|
||||||
|
|
||||||
|
|
||||||
|
$row = $row->toArray();
|
||||||
|
$row['prev'] = $prev;
|
||||||
|
$row['next'] = $next;
|
||||||
|
|
||||||
|
|
||||||
|
$this->setViews($id,$user_id,$oper_type,$user_id,$trans);
|
||||||
|
|
||||||
|
|
||||||
|
return $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**设置浏览量
|
||||||
|
* @param $id
|
||||||
|
* @param int $user_id
|
||||||
|
* @param bool $check
|
||||||
|
* @param bool $trans
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function setViews($id,$user_id,$oper_type='user',$oper_id=0,$trans=false){
|
||||||
|
$classes_lib = self::where("id",$id)->find();
|
||||||
|
if(!$classes_lib)throw new \Exception("找不到活动!");
|
||||||
|
//判断逻辑
|
||||||
|
if($trans){
|
||||||
|
self::beginTrans();
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
//事务逻辑
|
||||||
|
$classes_lib->views = $classes_lib->views + 1;
|
||||||
|
//查询是否已收藏
|
||||||
|
$classes_lib->save();
|
||||||
|
|
||||||
|
//调用事件
|
||||||
|
if($trans){
|
||||||
|
self::commitTrans();
|
||||||
|
}
|
||||||
|
}catch (\Exception $e){
|
||||||
|
if($trans){
|
||||||
|
self::rollbackTrans();
|
||||||
|
}
|
||||||
|
throw new \Exception($e->getMessage());
|
||||||
|
}
|
||||||
|
return $classes_lib;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
280
application/common/model/home/Information.php
Normal file
280
application/common/model/home/Information.php
Normal file
@ -0,0 +1,280 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\common\model\home;
|
||||||
|
|
||||||
|
use app\common\model\Attachment;
|
||||||
|
use think\Model;
|
||||||
|
use traits\model\SoftDelete;
|
||||||
|
|
||||||
|
class Information extends Model
|
||||||
|
{
|
||||||
|
|
||||||
|
use SoftDelete;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 表名
|
||||||
|
protected $name = 'information';
|
||||||
|
|
||||||
|
// 自动写入时间戳字段
|
||||||
|
protected $autoWriteTimestamp = 'integer';
|
||||||
|
|
||||||
|
// 定义时间戳字段名
|
||||||
|
protected $createTime = 'createtime';
|
||||||
|
protected $updateTime = 'updatetime';
|
||||||
|
protected $deleteTime = 'deletetime';
|
||||||
|
|
||||||
|
// 追加属性
|
||||||
|
protected $append = [
|
||||||
|
'type_text',
|
||||||
|
'recommend_text',
|
||||||
|
'release_time_text'
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
protected static function init()
|
||||||
|
{
|
||||||
|
self::afterInsert(function ($row) {
|
||||||
|
if (!$row['weigh']) {
|
||||||
|
$pk = $row->getPk();
|
||||||
|
$row->getQuery()->where($pk, $row[$pk])->update(['weigh' => $row[$pk]]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTypeList()
|
||||||
|
{
|
||||||
|
return ['1' => __('Type 1'), '2' => __('Type 2')];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getRecommendList()
|
||||||
|
{
|
||||||
|
return ['0' => __('Recommend 0'), '1' => __('Recommend 1')];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getTypeTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['type'] ?? '');
|
||||||
|
$list = $this->getTypeList();
|
||||||
|
return $list[$value] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getRecommendTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['recommend'] ?? '');
|
||||||
|
$list = $this->getRecommendList();
|
||||||
|
return $list[$value] ?? '';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getReleaseTimeTextAttr($value, $data)
|
||||||
|
{
|
||||||
|
$value = $value ?: ($data['release_time'] ?? '');
|
||||||
|
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setReleaseTimeAttr($value)
|
||||||
|
{
|
||||||
|
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function getImageAttr($value, $data)
|
||||||
|
{
|
||||||
|
if (!empty($value)) return cdnurl($value, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function attachment()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Attachment::class, 'file', 'url', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**得到基础条件
|
||||||
|
* @param $status
|
||||||
|
* @param null $model
|
||||||
|
* @param string $alisa
|
||||||
|
*/
|
||||||
|
public static function getBaseWhere($whereData = [], $model = null, $alisa = '',$with = false)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!$model) {
|
||||||
|
$model = new static;
|
||||||
|
if ($alisa&&!$with) $model = $model->alias($alisa);
|
||||||
|
}
|
||||||
|
if ($alisa) $alisa = $alisa . '.';
|
||||||
|
$tableFields = (new static)->getTableFields();
|
||||||
|
foreach ($tableFields as $fields)
|
||||||
|
{
|
||||||
|
if(in_array($fields, ['cate_id',"recommend","hot","fine"]))continue;
|
||||||
|
// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||||
|
|
||||||
|
if (isset($whereData[$fields]) && $whereData[$fields]){
|
||||||
|
if(is_array($whereData[$fields])){
|
||||||
|
$model = $model->where("{$alisa}{$fields}", $whereData[$fields][0], $whereData[$fields][1]);
|
||||||
|
}else{
|
||||||
|
$model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (isset($whereData['hot']) && $whereData['hot']!=="" && $whereData['hot']!==null){
|
||||||
|
// $model = $model->where("{$alisa}hot", 'in', $whereData['hot'] );
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (isset($whereData['fine']) && $whereData['fine']!=="" && $whereData['fine']!==null){
|
||||||
|
// $model = $model->where("{$alisa}fine", 'in', $whereData['fine'] );
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($whereData['recommend']) && $whereData['recommend']!=="" && $whereData['recommend']!==null){
|
||||||
|
$model = $model->where("{$alisa}recommend", '=', $whereData['recommend'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($whereData['keywords'])&&$whereData['keywords']){
|
||||||
|
$model = $model->where("{$alisa}title|{$alisa}subtitle", 'LIKE', "%{$whereData['keywords']}%" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($whereData['cate_id'])&&$whereData['cate_id']){
|
||||||
|
$model = $model->where("{$alisa}cate_id", 'in', $whereData['cate_id'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($whereData['time'])&&$whereData['time']){
|
||||||
|
|
||||||
|
$model = $model->time(["{$alisa}release_time",$whereData['time']]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (isset($whereData['has_evaluate'])&&$whereData['has_evaluate']){
|
||||||
|
// //1查已评价 2查未评价
|
||||||
|
// if($whereData['has_evaluate'] == 1){
|
||||||
|
// //1查已评价
|
||||||
|
// $model = $model->where("{$alisa}classes_evaluate_id", '<>', 0);
|
||||||
|
// }else{
|
||||||
|
// //2查未评价
|
||||||
|
// $model = $model->whereExists(function ($query) use ($alisa) {
|
||||||
|
// $order_table_name = (new \app\common\model\school\classes\hourorder\Order())->getQuery()->getTable();
|
||||||
|
// $query->table($order_table_name)->where($order_table_name . '.classes_order_id=' . $alisa . 'id')->where('status', '=', '3');
|
||||||
|
// })->where("{$alisa}classes_evaluate_id", '=', 0);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
return $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public static function allList($page, $limit,$keywords,$recommend="",$cate_id=[],$params=[]){
|
||||||
|
$with_field = [
|
||||||
|
'attachment'=>['*'],
|
||||||
|
'base'=>['*'],
|
||||||
|
];
|
||||||
|
|
||||||
|
|
||||||
|
$alisa = (new self)->getWithAlisaName();
|
||||||
|
$sort = " {$alisa}.recommend desc,{$alisa}.weigh desc,{$alisa}.id desc";
|
||||||
|
|
||||||
|
|
||||||
|
// $sort = " recommend desc,weigh desc,id desc";
|
||||||
|
$serch_where = ['recommend'=>$recommend,'cate_id'=>$cate_id,'keywords'=>$keywords];
|
||||||
|
|
||||||
|
return (new self)->getBaseList(array_merge($serch_where,$params), $page, $limit,$sort,$with_field);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** 通用详情(后台api版本)
|
||||||
|
* @param $params
|
||||||
|
* @param $trans
|
||||||
|
* @return $this
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function detail($id,$show_field=[],$except_field=[],$user_id=0,$oper_type='user',$trans=false){
|
||||||
|
$row = $this->get($id);
|
||||||
|
if (!$row) {
|
||||||
|
throw new \Exception(__('No Results were found'));
|
||||||
|
}
|
||||||
|
|
||||||
|
//上一篇,下一篇
|
||||||
|
$prev = $this->where('id', '<', $row['id'])->order('id', 'desc')->find();
|
||||||
|
$next = $this->where('id', '>', $row['id'])->order('id', 'asc')->find();
|
||||||
|
|
||||||
|
if($show_field){
|
||||||
|
$row->visible($show_field);
|
||||||
|
}
|
||||||
|
if($except_field){
|
||||||
|
$row->hidden($except_field);
|
||||||
|
}
|
||||||
|
|
||||||
|
$row->attachment;
|
||||||
|
|
||||||
|
|
||||||
|
$row = $row->toArray();
|
||||||
|
$row['prev'] = $prev;
|
||||||
|
$row['next'] = $next;
|
||||||
|
|
||||||
|
|
||||||
|
$this->setViews($id,$user_id,$oper_type,$user_id,$trans);
|
||||||
|
|
||||||
|
|
||||||
|
return $row;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**设置浏览量
|
||||||
|
* @param $id
|
||||||
|
* @param int $user_id
|
||||||
|
* @param bool $check
|
||||||
|
* @param bool $trans
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function setViews($id,$user_id,$oper_type='user',$oper_id=0,$trans=false){
|
||||||
|
$classes_lib = self::where("id",$id)->find();
|
||||||
|
if(!$classes_lib)throw new \Exception("找不到活动!");
|
||||||
|
//判断逻辑
|
||||||
|
if($trans){
|
||||||
|
self::beginTrans();
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
//事务逻辑
|
||||||
|
$classes_lib->views = $classes_lib->views + 1;
|
||||||
|
//查询是否已收藏
|
||||||
|
$classes_lib->save();
|
||||||
|
|
||||||
|
//调用事件
|
||||||
|
if($trans){
|
||||||
|
self::commitTrans();
|
||||||
|
}
|
||||||
|
}catch (\Exception $e){
|
||||||
|
if($trans){
|
||||||
|
self::rollbackTrans();
|
||||||
|
}
|
||||||
|
throw new \Exception($e->getMessage());
|
||||||
|
}
|
||||||
|
return $classes_lib;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace app\common\model\home;
|
namespace app\common\model\home;
|
||||||
|
|
||||||
|
use app\common\model\Attachment;
|
||||||
use app\common\model\BaseModel;
|
use app\common\model\BaseModel;
|
||||||
use think\Model;
|
use think\Model;
|
||||||
use traits\model\SoftDelete;
|
use traits\model\SoftDelete;
|
||||||
@ -87,6 +88,13 @@ class News extends BaseModel
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function attachment()
|
||||||
|
{
|
||||||
|
return $this->belongsTo(Attachment::class, 'file', 'url', [], 'LEFT')->setEagerlyType(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -107,7 +115,7 @@ class News extends BaseModel
|
|||||||
$tableFields = (new static)->getTableFields();
|
$tableFields = (new static)->getTableFields();
|
||||||
foreach ($tableFields as $fields)
|
foreach ($tableFields as $fields)
|
||||||
{
|
{
|
||||||
if(in_array($fields, ['cate_id',"recommend"]))continue;
|
if(in_array($fields, ['cate_id',"recommend","hot","fine"]))continue;
|
||||||
// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||||
|
|
||||||
if (isset($whereData[$fields]) && $whereData[$fields]){
|
if (isset($whereData[$fields]) && $whereData[$fields]){
|
||||||
@ -122,16 +130,25 @@ class News extends BaseModel
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isset($whereData['hot']) && $whereData['hot']!=="" && $whereData['hot']!==null){
|
||||||
|
$model = $model->where("{$alisa}hot", 'in', $whereData['hot'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($whereData['fine']) && $whereData['fine']!=="" && $whereData['fine']!==null){
|
||||||
|
$model = $model->where("{$alisa}fine", 'in', $whereData['fine'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($whereData['recommend']) && $whereData['recommend']!=="" && $whereData['recommend']!==null){
|
||||||
|
$model = $model->where("{$alisa}recommend", '=', $whereData['recommend'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($whereData['keywords'])&&$whereData['keywords']){
|
if (isset($whereData['keywords'])&&$whereData['keywords']){
|
||||||
$model = $model->where("{$alisa}title|{$alisa}subtitle", 'LIKE', "%{$whereData['keywords']}%" );
|
$model = $model->where("{$alisa}title|{$alisa}subtitle", 'LIKE', "%{$whereData['keywords']}%" );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($whereData['recommend']) && $whereData['recommend']!=="" && $whereData['recommend']!==null){
|
|
||||||
$model = $model->where("{$alisa}recommend", '=', $whereData['recommend'] );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if (isset($whereData['cate_id'])&&$whereData['cate_id']){
|
if (isset($whereData['cate_id'])&&$whereData['cate_id']){
|
||||||
$model = $model->where("{$alisa}cate_id", 'in', $whereData['cate_id'] );
|
$model = $model->where("{$alisa}cate_id", 'in', $whereData['cate_id'] );
|
||||||
@ -169,12 +186,13 @@ class News extends BaseModel
|
|||||||
public static function allList($page, $limit,$keywords,$recommend="",$cate_id=[],$params=[]){
|
public static function allList($page, $limit,$keywords,$recommend="",$cate_id=[],$params=[]){
|
||||||
$with_field = [
|
$with_field = [
|
||||||
'cate'=>['image','name'],
|
'cate'=>['image','name'],
|
||||||
|
'attachment'=>['*'],
|
||||||
'base'=>['*'],
|
'base'=>['*'],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
$alisa = (new self)->getWithAlisaName();
|
$alisa = (new self)->getWithAlisaName();
|
||||||
$sort = "{$alisa}.weigh desc,{$alisa}.id desc";
|
$sort = " {$alisa}.recommend desc,{$alisa}.weigh desc,{$alisa}.id desc";
|
||||||
$serch_where = ['recommend'=>$recommend,'cate_id'=>$cate_id,'keywords'=>$keywords];
|
$serch_where = ['recommend'=>$recommend,'cate_id'=>$cate_id,'keywords'=>$keywords];
|
||||||
|
|
||||||
return (new self)->getBaseList(array_merge($serch_where,$params), $page, $limit,$sort,$with_field);
|
return (new self)->getBaseList(array_merge($serch_where,$params), $page, $limit,$sort,$with_field);
|
||||||
@ -188,7 +206,7 @@ class News extends BaseModel
|
|||||||
* @return $this
|
* @return $this
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
public function detail($id,$show_field=[],$except_field=[]){
|
public function detail($id,$show_field=[],$except_field=[],$user_id=0,$oper_type='user',$trans=false){
|
||||||
$row = $this->get($id);
|
$row = $this->get($id);
|
||||||
if (!$row) {
|
if (!$row) {
|
||||||
throw new \Exception(__('No Results were found'));
|
throw new \Exception(__('No Results were found'));
|
||||||
@ -204,10 +222,55 @@ class News extends BaseModel
|
|||||||
if($except_field){
|
if($except_field){
|
||||||
$row->hidden($except_field);
|
$row->hidden($except_field);
|
||||||
}
|
}
|
||||||
|
$row->attachment;
|
||||||
|
|
||||||
$row = $row->toArray();
|
$row = $row->toArray();
|
||||||
$row['prev'] = $prev;
|
$row['prev'] = $prev;
|
||||||
$row['next'] = $next;
|
$row['next'] = $next;
|
||||||
|
|
||||||
|
|
||||||
|
$this->setViews($id,$user_id,$oper_type,$user_id,$trans);
|
||||||
|
|
||||||
|
|
||||||
return $row;
|
return $row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**设置浏览量
|
||||||
|
* @param $id
|
||||||
|
* @param int $user_id
|
||||||
|
* @param bool $check
|
||||||
|
* @param bool $trans
|
||||||
|
* @throws \Exception
|
||||||
|
*/
|
||||||
|
public function setViews($id,$user_id,$oper_type='user',$oper_id=0,$trans=false){
|
||||||
|
$classes_lib = self::where("id",$id)->find();
|
||||||
|
if(!$classes_lib)throw new \Exception("找不到活动!");
|
||||||
|
//判断逻辑
|
||||||
|
if($trans){
|
||||||
|
self::beginTrans();
|
||||||
|
}
|
||||||
|
try{
|
||||||
|
//事务逻辑
|
||||||
|
$classes_lib->views = $classes_lib->views + 1;
|
||||||
|
//查询是否已收藏
|
||||||
|
$classes_lib->save();
|
||||||
|
|
||||||
|
//调用事件
|
||||||
|
if($trans){
|
||||||
|
self::commitTrans();
|
||||||
|
}
|
||||||
|
}catch (\Exception $e){
|
||||||
|
if($trans){
|
||||||
|
self::rollbackTrans();
|
||||||
|
}
|
||||||
|
throw new \Exception($e->getMessage());
|
||||||
|
}
|
||||||
|
return $classes_lib;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -73,6 +73,85 @@ class NewsCate extends BaseModel
|
|||||||
if (!empty($value)) return cdnurl($value, true);
|
if (!empty($value)) return cdnurl($value, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/**得到基础条件
|
||||||
|
* @param $status
|
||||||
|
* @param null $model
|
||||||
|
* @param string $alisa
|
||||||
|
*/
|
||||||
|
public static function getBaseWhere($whereData = [], $model = null, $alisa = '',$with = false)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (!$model) {
|
||||||
|
$model = new static;
|
||||||
|
if ($alisa&&!$with) $model = $model->alias($alisa);
|
||||||
|
}
|
||||||
|
if ($alisa) $alisa = $alisa . '.';
|
||||||
|
$tableFields = (new static)->getTableFields();
|
||||||
|
foreach ($tableFields as $fields)
|
||||||
|
{
|
||||||
|
if(in_array($fields, ["hot","home"]))continue;
|
||||||
|
// if (isset($whereData[$fields]) && $whereData[$fields]) $model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||||
|
|
||||||
|
if (isset($whereData[$fields]) && $whereData[$fields]){
|
||||||
|
if(is_array($whereData[$fields])){
|
||||||
|
$model = $model->where("{$alisa}{$fields}", $whereData[$fields][0], $whereData[$fields][1]);
|
||||||
|
}else{
|
||||||
|
$model = $model->where("{$alisa}{$fields}", '=', $whereData[$fields]);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($whereData['hot']) && $whereData['hot']!=="" && $whereData['hot']!==null){
|
||||||
|
$model = $model->where("{$alisa}hot", 'in', $whereData['hot'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($whereData['home']) && $whereData['home']!=="" && $whereData['home']!==null){
|
||||||
|
$model = $model->where("{$alisa}home", 'in', $whereData['home'] );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($whereData['keywords'])&&$whereData['keywords']){
|
||||||
|
$model = $model->where("{$alisa}name|{$alisa}flag", 'LIKE', "%{$whereData['keywords']}%" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (isset($whereData['time'])&&$whereData['time']){
|
||||||
|
|
||||||
|
$model = $model->time(["{$alisa}createtime",$whereData['time']]);
|
||||||
|
}
|
||||||
|
|
||||||
|
// if (isset($whereData['has_evaluate'])&&$whereData['has_evaluate']){
|
||||||
|
// //1查已评价 2查未评价
|
||||||
|
// if($whereData['has_evaluate'] == 1){
|
||||||
|
// //1查已评价
|
||||||
|
// $model = $model->where("{$alisa}classes_evaluate_id", '<>', 0);
|
||||||
|
// }else{
|
||||||
|
// //2查未评价
|
||||||
|
// $model = $model->whereExists(function ($query) use ($alisa) {
|
||||||
|
// $order_table_name = (new \app\common\model\school\classes\hourorder\Order())->getQuery()->getTable();
|
||||||
|
// $query->table($order_table_name)->where($order_table_name . '.classes_order_id=' . $alisa . 'id')->where('status', '=', '3');
|
||||||
|
// })->where("{$alisa}classes_evaluate_id", '=', 0);
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
return $model;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static function allList($page, $limit,$params=[]){
|
public static function allList($page, $limit,$params=[]){
|
||||||
|
|
||||||
|
|
||||||
|
File diff suppressed because one or more lines are too long
@ -23,7 +23,7 @@ return [
|
|||||||
* 可上传的文件类型
|
* 可上传的文件类型
|
||||||
* 如配置允许 pdf,ppt,docx,svg 等可能含有脚本的文件时,请先从服务器配置此类文件直接下载而不是预览
|
* 如配置允许 pdf,ppt,docx,svg 等可能含有脚本的文件时,请先从服务器配置此类文件直接下载而不是预览
|
||||||
*/
|
*/
|
||||||
'mimetype' => 'jpg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm',
|
'mimetype' => 'jpg,png,bmp,jpeg,gif,webp,zip,rar,wav,mp4,mp3,webm,pdf,doc,docx,xls,xlsx,ppt,pptx,svg',
|
||||||
/**
|
/**
|
||||||
* 是否支持批量上传
|
* 是否支持批量上传
|
||||||
*/
|
*/
|
||||||
|
1964
public/api.html
1964
public/api.html
File diff suppressed because it is too large
Load Diff
180
public/assets/js/backend/home/encyclopedia.js
Normal file
180
public/assets/js/backend/home/encyclopedia.js
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||||
|
|
||||||
|
var Controller = {
|
||||||
|
index: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
index_url: 'home/encyclopedia/index' + location.search,
|
||||||
|
add_url: 'home/encyclopedia/add',
|
||||||
|
edit_url: 'home/encyclopedia/edit',
|
||||||
|
del_url: 'home/encyclopedia/del',
|
||||||
|
multi_url: 'home/encyclopedia/multi',
|
||||||
|
import_url: 'home/encyclopedia/import',
|
||||||
|
table: 'encyclopedia',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'weigh',
|
||||||
|
fixedColumns: true,
|
||||||
|
fixedRightNumber: 1,
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
{field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'subtitle', title: __('Subtitle'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
|
||||||
|
{field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
|
||||||
|
// {field: 'content', title: __('Content')},
|
||||||
|
{field: 'file', title: __('File'), operate: false, formatter: Table.api.formatter.file},
|
||||||
|
{field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
|
||||||
|
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||||
|
{field: 'release_time', title: __('Release_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
|
{field: 'views', title: __('Views')},
|
||||||
|
{field: 'source', title: __('Source'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||||
|
|
||||||
|
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
|
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
},
|
||||||
|
recyclebin: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
'dragsort_url': ''
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: 'home/encyclopedia/recyclebin' + location.search,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'id',
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
{field: 'title', title: __('Title'), align: 'left'},
|
||||||
|
{
|
||||||
|
field: 'deletetime',
|
||||||
|
title: __('Deletetime'),
|
||||||
|
operate: 'RANGE',
|
||||||
|
addclass: 'datetimerange',
|
||||||
|
formatter: Table.api.formatter.datetime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'operate',
|
||||||
|
width: '140px',
|
||||||
|
title: __('Operate'),
|
||||||
|
table: table,
|
||||||
|
events: Table.api.events.operate,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
name: 'Restore',
|
||||||
|
text: __('Restore'),
|
||||||
|
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
|
||||||
|
icon: 'fa fa-rotate-left',
|
||||||
|
url: 'home/encyclopedia/restore',
|
||||||
|
refresh: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Destroy',
|
||||||
|
text: __('Destroy'),
|
||||||
|
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
|
||||||
|
icon: 'fa fa-times',
|
||||||
|
url: 'home/encyclopedia/destroy',
|
||||||
|
refresh: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
formatter: Table.api.formatter.operate
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
},
|
||||||
|
|
||||||
|
add: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
edit: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
bindevent: function () {
|
||||||
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
generrate.listen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var generrate = {
|
||||||
|
listen:function () {
|
||||||
|
this.offlineListen();
|
||||||
|
},
|
||||||
|
offlineListen:function () {
|
||||||
|
var that = this;
|
||||||
|
|
||||||
|
that.setOfflineType($("select[name='row[type]']").val());
|
||||||
|
|
||||||
|
// console.log($("input:radio[name='row[address_type]']").val())
|
||||||
|
// this.setOfflineType($("input:radio[name='row[address_type]']").val());
|
||||||
|
// $("input:radio[name='row[address_type]']").change(function (){
|
||||||
|
// that.setOfflineType($(this).val());
|
||||||
|
// });
|
||||||
|
//换成下拉选择监听
|
||||||
|
$("select[name='row[type]']").change(function (){
|
||||||
|
that.setOfflineType($(this).val());
|
||||||
|
});
|
||||||
|
},
|
||||||
|
setOfflineType:function (val) {
|
||||||
|
//1=富文本,2=PDF
|
||||||
|
switch (val) {
|
||||||
|
case '1':
|
||||||
|
$('.c_content').show();
|
||||||
|
$('.c_pdf').hide();
|
||||||
|
|
||||||
|
//fastadmin框架:清除附件,将附件限制去掉
|
||||||
|
|
||||||
|
$("#faupload-file").attr('data-mimetype', 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,image/svg+xml,application/zip');
|
||||||
|
$("#fachoose-file").attr('data-mimetype', 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,image/svg+xml,application/zip');
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
case '2':
|
||||||
|
$('.c_content').hide();
|
||||||
|
$('.c_pdf').show();
|
||||||
|
|
||||||
|
//fastadmin框架:清除附件,将附件限制调整成pdf
|
||||||
|
$("#faupload-file").attr('data-mimetype', 'application/pdf');
|
||||||
|
$("#fachoose-file").attr('data-mimetype', 'application/pdf');
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return Controller;
|
||||||
|
});
|
180
public/assets/js/backend/home/information.js
Normal file
180
public/assets/js/backend/home/information.js
Normal file
@ -0,0 +1,180 @@
|
|||||||
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||||
|
|
||||||
|
var Controller = {
|
||||||
|
index: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
index_url: 'home/information/index' + location.search,
|
||||||
|
add_url: 'home/information/add',
|
||||||
|
edit_url: 'home/information/edit',
|
||||||
|
del_url: 'home/information/del',
|
||||||
|
multi_url: 'home/information/multi',
|
||||||
|
import_url: 'home/information/import',
|
||||||
|
table: 'information',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'weigh',
|
||||||
|
fixedColumns: true,
|
||||||
|
fixedRightNumber: 1,
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
{field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'subtitle', title: __('Subtitle'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
|
||||||
|
{field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
|
||||||
|
// {field: 'content', title: __('Content')},
|
||||||
|
{field: 'file', title: __('File'), operate: false, formatter: Table.api.formatter.file},
|
||||||
|
{field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
|
||||||
|
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||||
|
{field: 'release_time', title: __('Release_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
|
{field: 'views', title: __('Views')},
|
||||||
|
{field: 'source', title: __('Source'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||||
|
|
||||||
|
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
|
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
},
|
||||||
|
recyclebin: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
'dragsort_url': ''
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: 'home/information/recyclebin' + location.search,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'id',
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
{field: 'title', title: __('Title'), align: 'left'},
|
||||||
|
{
|
||||||
|
field: 'deletetime',
|
||||||
|
title: __('Deletetime'),
|
||||||
|
operate: 'RANGE',
|
||||||
|
addclass: 'datetimerange',
|
||||||
|
formatter: Table.api.formatter.datetime
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'operate',
|
||||||
|
width: '140px',
|
||||||
|
title: __('Operate'),
|
||||||
|
table: table,
|
||||||
|
events: Table.api.events.operate,
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
name: 'Restore',
|
||||||
|
text: __('Restore'),
|
||||||
|
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
|
||||||
|
icon: 'fa fa-rotate-left',
|
||||||
|
url: 'home/information/restore',
|
||||||
|
refresh: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'Destroy',
|
||||||
|
text: __('Destroy'),
|
||||||
|
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
|
||||||
|
icon: 'fa fa-times',
|
||||||
|
url: 'home/information/destroy',
|
||||||
|
refresh: true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
formatter: Table.api.formatter.operate
|
||||||
|
}
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
},
|
||||||
|
|
||||||
|
add: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
edit: function () {
|
||||||
|
Controller.api.bindevent();
|
||||||
|
},
|
||||||
|
api: {
|
||||||
|
bindevent: function () {
|
||||||
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
generrate.listen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var generrate = {
|
||||||
|
listen:function () {
|
||||||
|
this.offlineListen();
|
||||||
|
},
|
||||||
|
offlineListen:function () {
|
||||||
|
var that = this;
|
||||||
|
|
||||||
|
that.setOfflineType($("select[name='row[type]']").val());
|
||||||
|
|
||||||
|
// console.log($("input:radio[name='row[address_type]']").val())
|
||||||
|
// this.setOfflineType($("input:radio[name='row[address_type]']").val());
|
||||||
|
// $("input:radio[name='row[address_type]']").change(function (){
|
||||||
|
// that.setOfflineType($(this).val());
|
||||||
|
// });
|
||||||
|
//换成下拉选择监听
|
||||||
|
$("select[name='row[type]']").change(function (){
|
||||||
|
that.setOfflineType($(this).val());
|
||||||
|
});
|
||||||
|
},
|
||||||
|
setOfflineType:function (val) {
|
||||||
|
//1=富文本,2=PDF
|
||||||
|
switch (val) {
|
||||||
|
case '1':
|
||||||
|
$('.c_content').show();
|
||||||
|
$('.c_pdf').hide();
|
||||||
|
|
||||||
|
//fastadmin框架:清除附件,将附件限制去掉
|
||||||
|
|
||||||
|
$("#faupload-file").attr('data-mimetype', 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,image/svg+xml,application/zip');
|
||||||
|
$("#fachoose-file").attr('data-mimetype', 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,image/svg+xml,application/zip');
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
case '2':
|
||||||
|
$('.c_content').hide();
|
||||||
|
$('.c_pdf').show();
|
||||||
|
|
||||||
|
//fastadmin框架:清除附件,将附件限制调整成pdf
|
||||||
|
$("#faupload-file").attr('data-mimetype', 'application/pdf');
|
||||||
|
$("#fachoose-file").attr('data-mimetype', 'application/pdf');
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return Controller;
|
||||||
|
});
|
@ -29,17 +29,27 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||||||
{checkbox: true},
|
{checkbox: true},
|
||||||
{field: 'id', title: __('Id')},
|
{field: 'id', title: __('Id')},
|
||||||
{field: 'cate_id', title: __('Cate_id')},
|
{field: 'cate_id', title: __('Cate_id')},
|
||||||
|
{field: 'cate.name', title: __('Cate.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
// {field: 'flag', title: __('Flag'), operate: 'LIKE', formatter: Table.api.formatter.flag},
|
||||||
{field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
{field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
{field: 'subtitle', title: __('Subtitle'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
{field: 'subtitle', title: __('Subtitle'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
|
||||||
|
{field: 'type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
|
||||||
// {field: 'content', title: __('Content')},
|
// {field: 'content', title: __('Content')},
|
||||||
|
{field: 'file', title: __('File'), operate: false, formatter: Table.api.formatter.file},
|
||||||
{field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
|
{field: 'recommend', title: __('Recommend'), searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
|
||||||
|
{field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal},
|
||||||
|
{field: 'fine', title: __('Fine'), searchList: {"0":__('Fine 0'),"1":__('Fine 1')}, formatter: Table.api.formatter.normal},
|
||||||
{field: 'weigh', title: __('Weigh'), operate: false},
|
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||||
{field: 'release_time', title: __('Release_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
{field: 'release_time', title: __('Release_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
{field: 'views', title: __('Views')},
|
{field: 'views', title: __('Views')},
|
||||||
|
{field: 'virtual_views', title: __('Virtual_views')},
|
||||||
|
{field: 'source', title: __('Source'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||||
|
|
||||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||||
{field: 'cate.name', title: __('Cate.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
||||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@ -118,8 +128,63 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||||||
api: {
|
api: {
|
||||||
bindevent: function () {
|
bindevent: function () {
|
||||||
Form.api.bindevent($("form[role=form]"));
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
generrate.listen();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
var generrate = {
|
||||||
|
listen:function () {
|
||||||
|
this.offlineListen();
|
||||||
|
},
|
||||||
|
offlineListen:function () {
|
||||||
|
var that = this;
|
||||||
|
|
||||||
|
that.setOfflineType($("select[name='row[type]']").val());
|
||||||
|
|
||||||
|
// console.log($("input:radio[name='row[address_type]']").val())
|
||||||
|
// this.setOfflineType($("input:radio[name='row[address_type]']").val());
|
||||||
|
// $("input:radio[name='row[address_type]']").change(function (){
|
||||||
|
// that.setOfflineType($(this).val());
|
||||||
|
// });
|
||||||
|
//换成下拉选择监听
|
||||||
|
$("select[name='row[type]']").change(function (){
|
||||||
|
that.setOfflineType($(this).val());
|
||||||
|
});
|
||||||
|
},
|
||||||
|
setOfflineType:function (val) {
|
||||||
|
//1=富文本,2=PDF
|
||||||
|
switch (val) {
|
||||||
|
case '1':
|
||||||
|
$('.c_content').show();
|
||||||
|
$('.c_pdf').hide();
|
||||||
|
|
||||||
|
//fastadmin框架:清除附件,将附件限制去掉
|
||||||
|
|
||||||
|
$("#faupload-file").attr('data-mimetype', 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,image/svg+xml,application/zip');
|
||||||
|
$("#fachoose-file").attr('data-mimetype', 'application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,image/svg+xml,application/zip');
|
||||||
|
|
||||||
|
|
||||||
|
break;
|
||||||
|
case '2':
|
||||||
|
$('.c_content').hide();
|
||||||
|
$('.c_pdf').show();
|
||||||
|
|
||||||
|
//fastadmin框架:清除附件,将附件限制调整成pdf
|
||||||
|
$("#faupload-file").attr('data-mimetype', 'application/pdf');
|
||||||
|
$("#fachoose-file").attr('data-mimetype', 'application/pdf');
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return Controller;
|
return Controller;
|
||||||
});
|
});
|
||||||
|
@ -22,12 +22,16 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||||
pk: 'id',
|
pk: 'id',
|
||||||
sortName: 'weigh',
|
sortName: 'weigh',
|
||||||
|
fixedColumns: true,
|
||||||
|
fixedRightNumber: 1,
|
||||||
columns: [
|
columns: [
|
||||||
[
|
[
|
||||||
{checkbox: true},
|
{checkbox: true},
|
||||||
{field: 'id', title: __('Id')},
|
{field: 'id', title: __('Id')},
|
||||||
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||||
{field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
{field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'flag', title: __('Flag'), operate: 'LIKE', formatter: Table.api.formatter.flag},
|
||||||
|
{field: 'home', title: __('Home'), searchList: {"0":__('Home 0'),"1":__('Home 1')}, formatter: Table.api.formatter.normal},
|
||||||
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
|
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
|
||||||
{field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal},
|
{field: 'hot', title: __('Hot'), searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal},
|
||||||
{field: 'weigh', title: __('Weigh'), operate: false},
|
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||||
|
BIN
public/uploads/20250521/2779b16602296b24497164478b0dc8b8.pdf
Normal file
BIN
public/uploads/20250521/2779b16602296b24497164478b0dc8b8.pdf
Normal file
Binary file not shown.
BIN
public/uploads/20250521/286d135bd481323f58469e2fe9c26ee4.pdf
Normal file
BIN
public/uploads/20250521/286d135bd481323f58469e2fe9c26ee4.pdf
Normal file
Binary file not shown.
BIN
public/uploads/20250521/30fe0a68aa364c602612422840b8bb0c.xlsx
Normal file
BIN
public/uploads/20250521/30fe0a68aa364c602612422840b8bb0c.xlsx
Normal file
Binary file not shown.
BIN
public/uploads/20250521/5ec0f93549241242e2265b4d113e841c.pdf
Normal file
BIN
public/uploads/20250521/5ec0f93549241242e2265b4d113e841c.pdf
Normal file
Binary file not shown.
BIN
public/uploads/20250521/6a98f41ad66721a615a1c40e62da6a7d.docx
Normal file
BIN
public/uploads/20250521/6a98f41ad66721a615a1c40e62da6a7d.docx
Normal file
Binary file not shown.
BIN
public/uploads/20250521/788ee09e62bf568e066bb064584bb89f.pdf
Normal file
BIN
public/uploads/20250521/788ee09e62bf568e066bb064584bb89f.pdf
Normal file
Binary file not shown.
BIN
public/uploads/20250521/7fa6a848861fa01f160a6f4d33b9c618.pdf
Normal file
BIN
public/uploads/20250521/7fa6a848861fa01f160a6f4d33b9c618.pdf
Normal file
Binary file not shown.
BIN
public/uploads/20250521/8f4403bab44e8905d2aa0a0455cde902.pdf
Normal file
BIN
public/uploads/20250521/8f4403bab44e8905d2aa0a0455cde902.pdf
Normal file
Binary file not shown.
BIN
public/uploads/20250521/90a917b310eb73564075401733f46332.pdf
Normal file
BIN
public/uploads/20250521/90a917b310eb73564075401733f46332.pdf
Normal file
Binary file not shown.
BIN
public/uploads/20250521/940ee0cf78ea748d14e64decc064a5a8.pdf
Normal file
BIN
public/uploads/20250521/940ee0cf78ea748d14e64decc064a5a8.pdf
Normal file
Binary file not shown.
BIN
public/uploads/20250521/b92772a2e0bab74c2a543488389b0676.pdf
Normal file
BIN
public/uploads/20250521/b92772a2e0bab74c2a543488389b0676.pdf
Normal file
Binary file not shown.
BIN
public/uploads/20250521/c858a4131cf15de59f140aba322d4656.pdf
Normal file
BIN
public/uploads/20250521/c858a4131cf15de59f140aba322d4656.pdf
Normal file
Binary file not shown.
BIN
public/uploads/20250521/e32a26612f393f62126681cf0bb40761.pdf
Normal file
BIN
public/uploads/20250521/e32a26612f393f62126681cf0bb40761.pdf
Normal file
Binary file not shown.
BIN
public/uploads/20250521/fed458e7e772d2ca96e10d2f4b404466.pdf
Normal file
BIN
public/uploads/20250521/fed458e7e772d2ca96e10d2f4b404466.pdf
Normal file
Binary file not shown.
BIN
public/uploads/20250521/ff5cd4bcd49fffb23b3c615374780ef1.pdf
Normal file
BIN
public/uploads/20250521/ff5cd4bcd49fffb23b3c615374780ef1.pdf
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user