Archives.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. <?php
  2. namespace app\admin\controller\cms;
  3. use addons\cms\library\FulltextSearch;
  4. use app\admin\model\cms\Channel;
  5. use app\admin\model\cms\ChannelAdmin;
  6. use app\admin\model\cms\Modelx;
  7. use app\common\controller\Backend;
  8. use app\common\model\User;
  9. use fast\Tree;
  10. use think\Db;
  11. use think\db\Query;
  12. use think\Hook;
  13. /**
  14. * 内容表
  15. *
  16. * @icon fa fa-file-text-o
  17. */
  18. class Archives extends Backend
  19. {
  20. /**
  21. * Archives模型对象
  22. */
  23. protected $model = null;
  24. protected $noNeedRight = ['get_fields_html', 'check_element_available', 'suggestion', 'copy', 'special', 'tags', 'move', 'flag'];
  25. protected $channelIds = [];
  26. protected $isSuperAdmin = false;
  27. protected $searchFields = 'id,title';
  28. public function _initialize()
  29. {
  30. parent::_initialize();
  31. $this->model = new \app\admin\model\cms\Archives;
  32. $config = get_addon_config('cms');
  33. if ($config['archivesdatalimit'] != 'all') {
  34. $this->dataLimit = $config['archivesdatalimit'];
  35. }
  36. //复制/加入专题/修改标签均检测编辑权限
  37. if (in_array($this->request->action(), ['copy', 'special', 'tags', 'move', 'flag']) && !$this->auth->check('cms/archives/edit')) {
  38. Hook::listen('admin_nopermission', $this);
  39. $this->error(__('You have no permission'), '');
  40. }
  41. //是否超级管理员
  42. $this->isSuperAdmin = $this->auth->isSuperAdmin();
  43. $channelList = [];
  44. $disabledIds = [];
  45. $all = collection(Channel::order("weigh desc,id desc")->select())->toArray();
  46. //允许的栏目
  47. $this->channelIds = $this->isSuperAdmin || !$config['channelallocate'] ? Channel::column('id') : ChannelAdmin::getAdminChanneIds();
  48. $parentChannelIds = Channel::where('id', 'in', $this->channelIds)->column('parent_id');
  49. $parentChannelIds = array_unique($parentChannelIds);
  50. $parentChannelList = \think\Db::name('cms_channel')->where('id', 'in', $parentChannelIds)->where('parent_id', '<>', 0)->field('id,parent_id,name')->select();
  51. $tree = Tree::instance()->init($all, 'parent_id');
  52. foreach ($parentChannelList as $index => $channel) {
  53. $parentChannelIds = array_merge($parentChannelIds, $tree->getParentsIds($channel['parent_id'], true));
  54. }
  55. $this->channelIds = array_merge($parentChannelIds, $this->channelIds);
  56. foreach ($all as $k => $v) {
  57. $state = ['opened' => true];
  58. if ($v['type'] == 'link') {
  59. $disabledIds[] = $v['id'];
  60. }
  61. if ($v['type'] == 'link') {
  62. $state['checkbox_disabled'] = true;
  63. }
  64. if (!$this->isSuperAdmin) {
  65. if (!in_array($v['id'], $parentChannelIds) && !in_array($v['id'], $this->channelIds)) {
  66. unset($all[$k]);
  67. continue;
  68. }
  69. }
  70. $channelList[] = [
  71. 'id' => $v['id'],
  72. 'parent' => $v['parent_id'] ? $v['parent_id'] : '#',
  73. 'text' => __($v['name']),
  74. 'type' => $v['type'],
  75. 'state' => $state
  76. ];
  77. }
  78. $tree = Tree::instance()->init($all, 'parent_id');
  79. $channelOptions = $tree->getTree(0, "<option model='@model_id' value=@id @selected @disabled>@spacer@name</option>", '', $disabledIds);
  80. $secondChannelOptions = $tree->getTree(0, "<option model='@model_id' value=@id disabled>@spacer@name</option>", '', $disabledIds);
  81. $this->view->assign('channelOptions', $channelOptions);
  82. $this->view->assign('secondChannelOptions', $secondChannelOptions);
  83. $this->assignconfig('channelList', $channelList);
  84. $this->assignconfig('spiderRecord', intval($config['spiderrecord'] ?? 0));
  85. $this->assignconfig("flagList", $this->model->getFlagList());
  86. $this->view->assign("flagList", $this->model->getFlagList());
  87. $this->view->assign("statusList", $this->model->getStatusList());
  88. $this->assignconfig('cms', ['archiveseditmode' => $config['archiveseditmode']]);
  89. }
  90. /**
  91. * 查看
  92. */
  93. public function index()
  94. {
  95. //设置过滤方法
  96. $this->request->filter(['strip_tags']);
  97. if ($this->request->isAjax()) {
  98. $this->relationSearch = true;
  99. //如果发送的来源是Selectpage,则转发到Selectpage
  100. if ($this->request->request('keyField')) {
  101. return $this->selectpage();
  102. }
  103. list($where, $sort, $order, $offset, $limit) = $this->buildparams();
  104. if (!$this->auth->isSuperAdmin()) {
  105. $this->model->where('channel_id', 'in', $this->channelIds);
  106. }
  107. $total = $this->model
  108. ->with('Channel')
  109. ->where($where)
  110. ->order($sort, $order)
  111. ->count();
  112. if (!$this->auth->isSuperAdmin()) {
  113. $this->model->where('channel_id', 'in', $this->channelIds);
  114. }
  115. $list = $this->model
  116. ->with(['Channel'])
  117. ->where($where)
  118. ->order($sort, $order)
  119. ->limit($offset, $limit)
  120. ->select();
  121. addtion($list, [
  122. [
  123. 'field' => 'channel_ids',
  124. 'display' => 'channel_ids',
  125. 'model' => Channel::class,
  126. ],
  127. ]);
  128. \app\admin\model\cms\SpiderLog::render($list, 'archives');
  129. $result = array("total" => $total, "rows" => $list);
  130. return json($result);
  131. }
  132. $modelList = \app\admin\model\cms\Modelx::all();
  133. $specialList = \app\admin\model\cms\Special::where('status', 'normal')->select();
  134. $this->view->assign('modelList', $modelList);
  135. $this->view->assign('specialList', $specialList);
  136. return $this->view->fetch();
  137. }
  138. /**
  139. * 副表内容
  140. */
  141. public function content($model_id = null)
  142. {
  143. $model = \app\admin\model\cms\Modelx::get($model_id);
  144. if (!$model) {
  145. $this->error('未找到对应模型');
  146. }
  147. $fieldsList = \app\admin\model\cms\Fields::where('source', 'model')->where('source_id', $model['id'])->where('type', '<>', 'text')->select();
  148. //设置过滤方法
  149. $this->request->filter(['strip_tags', 'trim']);
  150. if ($this->request->isAjax()) {
  151. //如果发送的来源是Selectpage,则转发到Selectpage
  152. if ($this->request->request('keyField')) {
  153. return $this->selectpage();
  154. }
  155. $fields = [];
  156. foreach ($fieldsList as $index => $item) {
  157. $fields[] = "addon." . $item['name'];
  158. }
  159. $filter = $this->request->request('filter');
  160. $op = $this->request->request('op');
  161. if ($filter && $op) {
  162. $filterArr = json_decode($filter, true);
  163. $opArr = json_decode($op, true);
  164. foreach ($filterArr as $index => $item) {
  165. if (in_array("addon." . $index, $fields)) {
  166. $filterArr["addon." . $index] = $item;
  167. $opArr["addon." . $index] = $opArr[$index];
  168. unset($filterArr[$index], $opArr[$index]);
  169. }
  170. }
  171. $this->request->get(['filter' => json_encode($filterArr), 'op' => json_encode($opArr)]);
  172. }
  173. $this->searchFields = "archives.id,archives.title";
  174. $this->relationSearch = true;
  175. $table = $this->model->getTable();
  176. list($where, $sort, $order, $offset, $limit, $page, $alias) = $this->buildparams();
  177. $sort = 'archives.id';
  178. $isSuperAdmin = $this->isSuperAdmin;
  179. $channelIds = $this->channelIds;
  180. $customWhere = function ($query) use ($isSuperAdmin, $channelIds, $model_id) {
  181. if (!$isSuperAdmin) {
  182. $query->where('archives.channel_id', 'in', $channelIds);
  183. }
  184. if ($model_id) {
  185. $query->where('archives.model_id', $model_id);
  186. }
  187. };
  188. $list = $this->model
  189. ->alias($alias)
  190. ->alias('archives')
  191. ->join('cms_channel channel', 'channel.id=archives.channel_id', 'LEFT')
  192. ->join($model['table'] . ' addon', 'addon.id=archives.id', 'LEFT')
  193. ->field('archives.*,channel.name as channel_name,addon.id as aid' . ($fields ? ',' . implode(',', $fields) : ''))
  194. ->where($customWhere)
  195. ->whereNull('deletetime')
  196. ->where($where)
  197. ->order($sort, $order)
  198. ->paginate($limit);
  199. $result = array("total" => $list->total(), "rows" => $list->items());
  200. return json($result);
  201. }
  202. $fields = [];
  203. foreach ($fieldsList as $index => $item) {
  204. $fields[] = ['field' => $item['name'], 'title' => $item['title'], 'type' => $item['type'], 'content' => $item['content_list']];
  205. }
  206. $this->assignconfig('fields', $fields);
  207. $this->view->assign('fieldsList', $fieldsList);
  208. $this->view->assign('model', $model);
  209. $this->assignconfig('model_id', $model_id);
  210. $modelList = \app\admin\model\cms\Modelx::all();
  211. $this->view->assign('modelList', $modelList);
  212. return $this->view->fetch();
  213. }
  214. /**
  215. * 编辑
  216. *
  217. * @param mixed $ids
  218. * @return string
  219. */
  220. public function edit($ids = null)
  221. {
  222. $row = $this->model->get($ids);
  223. if (!$row) {
  224. $this->error(__('No Results were found'));
  225. }
  226. $adminIds = $this->getDataLimitAdminIds();
  227. if (is_array($adminIds)) {
  228. if (!in_array($row[$this->dataLimitField], $adminIds)) {
  229. $this->error(__('You have no permission'));
  230. }
  231. }
  232. if (!$this->isSuperAdmin && !in_array($row['channel_id'], $this->channelIds)) {
  233. $this->error(__('You have no permission'));
  234. }
  235. if ($this->request->isPost()) {
  236. return parent::edit($ids);
  237. }
  238. $channel = Channel::get($row['channel_id']);
  239. if (!$channel) {
  240. $channel = Channel::get(40);
  241. // $this->error(__('No specified channel found'));
  242. }
  243. $model = \app\admin\model\cms\Modelx::get($channel['model_id']);
  244. if (!$model) {
  245. $this->error(__('No specified model found'));
  246. }
  247. $addon = db($model['table'])->where('id', $row['id'])->find();
  248. if ($addon) {
  249. $row->setData($addon);
  250. }
  251. $disabledIds = [];
  252. $all = collection(Channel::order("weigh desc,id desc")->select())->toArray();
  253. foreach ($all as $k => $v) {
  254. if ($v['type'] == 'link' || $v['model_id'] != $channel['model_id']) {
  255. $disabledIds[] = $v['id'];
  256. }
  257. }
  258. $disabledIds = array_diff($disabledIds, [$row['channel_id']]);
  259. $tree = Tree::instance()->init($all, 'parent_id');
  260. $channelOptions = $tree->getTree(0, "<option model='@model_id' value=@id @selected @disabled>@spacer@name</option>", $row['channel_id'], $disabledIds);
  261. $secondChannelOptions = $tree->getTree(0, "<option model='@model_id' value=@id @selected @disabled>@spacer@name</option>", explode(',', $row['channel_ids']), $disabledIds);
  262. $this->view->assign('channelOptions', $channelOptions);
  263. $this->view->assign('secondChannelOptions', $secondChannelOptions);
  264. $this->view->assign("row", $row);
  265. return $this->view->fetch();
  266. }
  267. /**
  268. * 删除
  269. * @param mixed $ids
  270. */
  271. public function del($ids = "")
  272. {
  273. parent::del($ids);
  274. }
  275. /**
  276. * 销毁
  277. * @param string $ids
  278. */
  279. public function destroy($ids = "")
  280. {
  281. \app\admin\model\cms\Archives::event('after_delete', function ($row) {
  282. //删除副表
  283. $channel = Channel::get($row->channel_id);
  284. if ($channel) {
  285. $model = Modelx::get($channel['model_id']);
  286. if ($model) {
  287. db($model['table'])->where("id", $row['id'])->delete();
  288. }
  289. }
  290. });
  291. parent::destroy($ids);
  292. }
  293. /**
  294. * 还原
  295. * @param mixed $ids
  296. */
  297. public function restore($ids = "")
  298. {
  299. if (!$this->request->isPost()) {
  300. $this->error(__("Invalid parameters"));
  301. }
  302. $pk = $this->model->getPk();
  303. $adminIds = $this->getDataLimitAdminIds();
  304. if (is_array($adminIds)) {
  305. $this->model->where($this->dataLimitField, 'in', $adminIds);
  306. }
  307. if ($ids) {
  308. $this->model->where($pk, 'in', $ids);
  309. }
  310. $config = get_addon_config('cms');
  311. $list = $this->model->onlyTrashed()->select();
  312. if ($list) {
  313. $ids = [];
  314. $refreshIds = [];
  315. foreach ($list as $index => $item) {
  316. if ($item['status'] == 'normal') {
  317. User::score($config['score']['postarchives'], $item['user_id'], '发布文章');
  318. }
  319. $ids[] = $item['id'];
  320. $refreshIds = array_merge([$item['channel_id']], explode(',', $item['channel_ids']));
  321. $refreshIds = array_filter(array_unique($refreshIds));
  322. }
  323. $this->model->where('id', 'in', $ids);
  324. $this->model->restore('1=1');
  325. Channel::refreshItems($refreshIds);
  326. $this->success();
  327. }
  328. $this->error(__('No rows were updated'));
  329. }
  330. /**
  331. * 移动
  332. * @param string $ids
  333. */
  334. public function move($ids = "")
  335. {
  336. if (!$this->request->isPost()) {
  337. $this->error(__("Invalid parameters"));
  338. }
  339. if ($ids) {
  340. if (!$this->request->isPost()) {
  341. $this->error(__("Invalid parameters"));
  342. }
  343. $channel_id = $this->request->post('channel_id');
  344. $pk = $this->model->getPk();
  345. $adminIds = $this->getDataLimitAdminIds();
  346. if (is_array($adminIds)) {
  347. $this->model->where($this->dataLimitField, 'in', $adminIds);
  348. }
  349. $this->model->where($pk, 'in', $ids);
  350. $channel = Channel::get($channel_id);
  351. if ($channel && $channel['type'] === 'list') {
  352. $channelNums = \app\admin\model\cms\Archives::
  353. with('channel')
  354. ->where('archives.' . $pk, 'in', $ids)
  355. ->where('channel_id', '<>', $channel['id'])
  356. ->field('channel_id,COUNT(*) AS nums')
  357. ->group('channel_id')
  358. ->select();
  359. $result = $this->model
  360. ->where('model_id', '=', $channel['model_id'])
  361. ->where('channel_id', '<>', $channel['id'])
  362. ->update(['channel_id' => $channel_id]);
  363. if ($result) {
  364. $this->success();
  365. } else {
  366. $this->error(__('No rows were updated'));
  367. }
  368. } else {
  369. $this->error(__('No rows were updated'));
  370. }
  371. $this->error(__('Parameter %s can not be empty', 'ids'));
  372. }
  373. }
  374. /**
  375. * 复制选择行
  376. * @param string $ids
  377. */
  378. public function copy($ids = "")
  379. {
  380. if (!$this->request->isPost()) {
  381. $this->error(__("Invalid parameters"));
  382. }
  383. if ($ids) {
  384. $pk = $this->model->getPk();
  385. $adminIds = $this->getDataLimitAdminIds();
  386. if (is_array($adminIds)) {
  387. $this->model->where($this->dataLimitField, 'in', $adminIds);
  388. }
  389. $archivesList = $this->model->where('id', 'in', $ids)->select();
  390. foreach ($archivesList as $index => $item) {
  391. try {
  392. $model = Modelx::get($item['model_id']);
  393. $addon = \think\Db::name($model['table'])->find($item['id']);
  394. $data = $item->toArray();
  395. $data = array_merge($data, $addon ?? []);
  396. $data['title'] = $data['title'] . "_copy";
  397. $data['status'] = 'hidden';
  398. unset($data['id']);
  399. \app\admin\model\cms\Archives::create($data, true);
  400. } catch (\Exception $e) {
  401. //
  402. }
  403. }
  404. $this->success();
  405. $this->error(__('Parameter %s can not be empty', 'ids'));
  406. }
  407. }
  408. /**
  409. * 加入专题
  410. * @param string $ids
  411. */
  412. public function special($ids = "")
  413. {
  414. if (!$this->request->isPost()) {
  415. $this->error(__("Invalid parameters"));
  416. }
  417. if ($ids) {
  418. $special_id = $this->request->post('special_id');
  419. $pk = $this->model->getPk();
  420. $adminIds = $this->getDataLimitAdminIds();
  421. if (is_array($adminIds)) {
  422. $this->model->where($this->dataLimitField, 'in', $adminIds);
  423. }
  424. $special = \app\admin\model\cms\Special::get($special_id);
  425. if ($special) {
  426. $archivesList = $this->model->where($pk, 'in', $ids)->select();
  427. foreach ($archivesList as $index => $item) {
  428. $special_ids = explode(',', $item['special_ids']);
  429. if (!in_array($special['id'], $special_ids)) {
  430. $special_ids[] = $special['id'];
  431. $item->save(['special_ids' => implode(',', array_unique(array_filter($special_ids)))]);
  432. }
  433. }
  434. $this->success();
  435. } else {
  436. $this->error(__('No rows were updated'));
  437. }
  438. }
  439. $this->error(__('Please select at least one row'));
  440. }
  441. /**
  442. * 加入标签
  443. * @param string $ids
  444. */
  445. public function tags($ids = "")
  446. {
  447. if (!$this->request->isPost()) {
  448. $this->error(__("Invalid parameters"));
  449. }
  450. if ($ids) {
  451. $tags = $this->request->post('tags');
  452. $newTagsArr = array_filter(explode(',', $tags));
  453. if ($newTagsArr) {
  454. $pk = $this->model->getPk();
  455. $adminIds = $this->getDataLimitAdminIds();
  456. if (is_array($adminIds)) {
  457. $this->model->where($this->dataLimitField, 'in', $adminIds);
  458. }
  459. $archivesList = $this->model->where($pk, 'in', $ids)->select();
  460. foreach ($archivesList as $index => $item) {
  461. $tagsArr = explode(',', $item['tags']);
  462. $tagsArr = array_merge($tagsArr, $newTagsArr);
  463. $item->save(['tags' => implode(',', array_unique(array_filter($tagsArr)))]);
  464. }
  465. $this->success();
  466. } else {
  467. $this->error(__('标签数据不能为空'));
  468. }
  469. }
  470. $this->error(__('Please select at least one row'));
  471. }
  472. /**
  473. * 修改标志
  474. * @param string $ids
  475. */
  476. public function flag($ids = "")
  477. {
  478. if (!$this->request->isPost()) {
  479. $this->error(__("Invalid parameters"));
  480. }
  481. if ($ids) {
  482. $type = $this->request->post('type');
  483. $flag = $this->request->post('flag');
  484. $changeFlagArr = array_filter(explode(',', $flag));
  485. if ($changeFlagArr) {
  486. $pk = $this->model->getPk();
  487. $adminIds = $this->getDataLimitAdminIds();
  488. if (is_array($adminIds)) {
  489. $this->model->where($this->dataLimitField, 'in', $adminIds);
  490. }
  491. $archivesList = $this->model->where($pk, 'in', $ids)->select();
  492. foreach ($archivesList as $index => $item) {
  493. $flagArr = explode(',', $item['flag']);
  494. if ($type == 'add') {
  495. $flagArr = array_merge($flagArr, $changeFlagArr);
  496. } else {
  497. $flagArr = array_diff($flagArr, $changeFlagArr);
  498. }
  499. $item->save(['flag' => implode(',', array_unique(array_filter($flagArr)))]);
  500. }
  501. $this->success();
  502. } else {
  503. $this->error(__('标志数据不能为空'));
  504. }
  505. }
  506. $this->error(__('Please select at least one row'));
  507. }
  508. /**
  509. * 获取栏目列表
  510. * @internal
  511. */
  512. public function get_fields_html()
  513. {
  514. $this->view->engine->layout(false);
  515. $channel_id = $this->request->post('channel_id');
  516. $archives_id = $this->request->post('archives_id');
  517. $channel = Channel::get($channel_id, 'model');
  518. if ($channel) {
  519. $model_id = $channel['model_id'];
  520. $values = [];
  521. if ($archives_id) {
  522. $values = db($channel['model']['table'])->where('id', $archives_id)->find();
  523. //优先从栏目获取模型ID,再从文档获取
  524. $archives = \app\admin\model\cms\Archives::get($archives_id);
  525. $model_id = $archives ? $archives['model_id'] : $model_id;
  526. }
  527. $fields = \addons\cms\library\Service::getCustomFields('model', $model_id, $values);
  528. $model = Modelx::get($model_id);
  529. $setting = $model['setting'];
  530. $publishfields = isset($setting['publishfields']) ? $setting['publishfields'] : [];
  531. $titlelist = isset($setting['titlelist']) ? $setting['titlelist'] : [];
  532. $this->view->assign('channel', $channel);
  533. $this->view->assign('fields', $fields);
  534. $this->view->assign('values', $values);
  535. $this->success('', null, ['html' => $this->view->fetch('cms/common/fields'), 'publishfields' => $publishfields, 'titlelist' => $titlelist]);
  536. } else {
  537. $this->error(__('Please select channel'));
  538. }
  539. $this->error(__('Parameter %s can not be empty', 'ids'));
  540. }
  541. /**
  542. * 检测元素是否可用
  543. * @internal
  544. */
  545. public function check_element_available()
  546. {
  547. $id = $this->request->request('id');
  548. $name = $this->request->request('name');
  549. $value = $this->request->request('value');
  550. $name = substr($name, 4, -1);
  551. if (!$name) {
  552. $this->error(__('Parameter %s can not be empty', 'name'));
  553. }
  554. if ($id) {
  555. $this->model->where('id', '<>', $id);
  556. }
  557. $exist = $this->model->where($name, $value)->find();
  558. if ($exist) {
  559. $this->error(__('The data already exist'));
  560. } else {
  561. $this->success();
  562. }
  563. }
  564. /**
  565. * 搜索建议
  566. * @internal
  567. */
  568. public function suggestion()
  569. {
  570. $config = get_addon_config('cms');
  571. $q = trim($this->request->request("q"));
  572. $id = trim($this->request->request("id/d"));
  573. $list = [];
  574. if ($config['searchtype'] == 'xunsearch') {
  575. $result = FulltextSearch::search($q, 1, 10);
  576. } else {
  577. $result = $this->model->where("title|keywords|description", "like", "%{$q}%")->where('id', '<>', $id)->limit(10)->order("id", "desc")->select();
  578. foreach ($result as $index => $item) {
  579. $item['image'] = $item['image'] ? $item['image'] : '/assets/addons/cms/img/noimage.png';
  580. $list[] = ['id' => $item['id'], 'url' => $item['fullurl'], 'image' => cdnurl($item['image']), 'title' => $item['title'], 'create_date' => datetime($item['createtime']), 'status' => $item['status'], 'status_text' => $item['status_text'], 'deletetime' => $item['deletetime']];
  581. }
  582. }
  583. return json($list);
  584. }
  585. }