1234567891011121314151617181920212223242526272829303132333435363738 |
- <?php
- namespace app\businessmanage\controller;
- use app\business\model\BusinessModel;
- use cmf\controller\AdminBaseController;
- class AdminBusinessManageController extends AdminBaseController
- {
- /**
- * 活动列表
- */
- public function index()
- {
- $param = $this->request->param();
- //搜索条件
- $where = [];
- if (!empty($param['keyword'])) {
- $where[] = ['title', 'like', "%{$param['keyword']}%"];
- }
- $list = BusinessModel::where($where)->paginate(10, false, ['query' => $param]);
- if (!$list->isEmpty()) {
- foreach ($list as $v) {
- if (!empty($v['tags'])) {
- $v['tags'] = implode(' ',json_decode($v['tags'],true));
- }
- }
- }
- $this->assign('keyword', isset($param['keyword']) ? $param['keyword'] : '');
- $this->assign('list', $list->items());
- $this->assign('page', $list->render());
- return $this->fetch();
- }
- }
|