diff --git a/plugs/think-plugs-cms/src/controller/Thumb.php b/plugs/think-plugs-cms/src/controller/Thumb.php new file mode 100644 index 0000000..5239bca --- /dev/null +++ b/plugs/think-plugs-cms/src/controller/Thumb.php @@ -0,0 +1,63 @@ +title = '点赞城市管理'; + CmsThumb::mQuery()->layTable(function () { + }, static function (QueryHelper $query) { + $query->equal('status')->like('name'); + }); + } + + public function add() + { + $this->title = '添加点赞城市'; + CmsThumb::mForm('form'); + } + + public function edit() + { + $this->title = '编辑点赞城市'; + $this->id = $this->request->param('id', 0, 'intval'); //当前栏目ID + CmsThumb::mForm('form'); + } + + public function remove() + { + CmsThumb::mDelete('id'); + } + + public function status() + { + CmsThumb::mSave($this->_vali([ + 'id.require' => '点赞城市ID不能为空', + 'status.in:0,1' => '状态值范围异常!', + 'status.require' => '状态值不能为空!', + ]), 'id'); + } + + + public function _status_save_result($state, $data) + { + if ($state) { + $status = $this->request->param('status'); + $id = $this->request->param('id'); + if ($status == 1) { + CmsThumb::mk()->where('id', $id)->save([ + 'publish_at' => date('Y-m-d H:i:s') + ]); + } + } + } +} \ No newline at end of file diff --git a/plugs/think-plugs-cms/src/model/CmsThumb.php b/plugs/think-plugs-cms/src/model/CmsThumb.php new file mode 100644 index 0000000..e6cb113 --- /dev/null +++ b/plugs/think-plugs-cms/src/model/CmsThumb.php @@ -0,0 +1,10 @@ + +
+
+ +
+ +
+
+
+ +
+ + + image +
+
+
+ +
+ +
+
+
+ {notempty name='id'}{/notempty} + +
+ + +
+ + diff --git a/plugs/think-plugs-cms/src/view/thumb/index.html b/plugs/think-plugs-cms/src/view/thumb/index.html new file mode 100644 index 0000000..53db545 --- /dev/null +++ b/plugs/think-plugs-cms/src/view/thumb/index.html @@ -0,0 +1,80 @@ +{extend name="table"} + +{block name="button"} + + + +{/block} + +{block name="content"} +
+
+
+
+ {include file='article/index_search'} +
+
+
+
+
+ +{/block} + +{block name='style'} + +{/block} + +{block name='script'} + +{/block} \ No newline at end of file diff --git a/plugs/think-plugs-cms/src/view/thumb/index_search.html b/plugs/think-plugs-cms/src/view/thumb/index_search.html new file mode 100644 index 0000000..8ddacd7 --- /dev/null +++ b/plugs/think-plugs-cms/src/view/thumb/index_search.html @@ -0,0 +1,23 @@ +
+ 条件搜索 + + +
diff --git a/plugs/think-plugs-ticket/src/model/TicketUserShare.php b/plugs/think-plugs-ticket/src/model/TicketUserShare.php index cd1181f..a9c4284 100644 --- a/plugs/think-plugs-ticket/src/model/TicketUserShare.php +++ b/plugs/think-plugs-ticket/src/model/TicketUserShare.php @@ -6,6 +6,7 @@ use think\admin\Model; class TicketUserShare extends Model { + protected $append = ['type_name', 'imgs_arr']; public function getImgsArrAttr($value, $data) { return str2arr($data['imgs'] ?: '', '|');