SellerEditablePage.php 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. use think\facade\Db;
  6. /**
  7. * ============================================================================
  8. *
  9. * ============================================================================
  10. *
  11. * ----------------------------------------------------------------------------
  12. *
  13. * ============================================================================
  14. * 控制器
  15. */
  16. class SellerEditablePage extends BaseSeller
  17. {
  18. var $type = 'pc';
  19. var $model_dir = 'home@default/base/editable_page_model/';
  20. public function initialize()
  21. {
  22. parent::initialize();
  23. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/seller_editable_page.lang.php');
  24. Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '.php');
  25. }
  26. public function page_list($type = 'pc')
  27. {
  28. $this->type = $type;
  29. $keyword = input('param.editable_page_name');
  30. $condition = array();
  31. if ($keyword) {
  32. $condition[] = array('editable_page_name', 'like', '%' . $keyword . '%');
  33. }
  34. View::assign('filtered', empty($condition) ? 0 : 1);
  35. if (!in_array($type, array('pc', 'h5'))) {
  36. $type = 'pc';
  37. }
  38. $editable_page_model = model('editable_page');
  39. $condition = array_merge(array(array('store_id', '=', $this->store_info['store_id']), array('editable_page_client', '=', $type)), $condition);
  40. $editable_page_list = $editable_page_model->getEditablePageList($condition, 10);
  41. foreach ($editable_page_list as $key => $val) {
  42. if ($val['editable_page_client'] == 'pc') {
  43. $editable_page_list[$key]['edit_url'] = (string)url('SellerEditablePage/page_setting', ['store_id' => $this->store_info['store_id'], 'editable_page_id' => $val['editable_page_id']]);
  44. $editable_page_list[$key]['view_url'] = (string)url('StoreSpecial/index', ['store_id' => $this->store_info['store_id'], 'special_id' => $val['editable_page_id']]);
  45. } else {
  46. $editable_page_list[$key]['edit_url'] = (string)url('SellerEditablePage/mobile_page_setting', array('store_id' => $this->store_info['store_id'], 'editable_page_id' => $val['editable_page_id']));
  47. $editable_page_list[$key]['view_url'] = config('ds_config.h5_site_url') . '/' . 'pages/home/storespecial/Index' . '?' . http_build_query(['id' => $this->store_info['store_id'], 'special_id' => $val['editable_page_id']]);
  48. }
  49. }
  50. View::assign('show_page', $editable_page_model->page_info->render());
  51. View::assign('editable_page_list', $editable_page_list);
  52. View::assign('type', $type);
  53. /* 设置卖家当前菜单 */
  54. $this->setSellerCurMenu($type == 'h5' ? 'seller_editable_page_h5' : 'seller_editable_page_pc');
  55. /* 设置卖家当前栏目 */
  56. $this->setSellerCurItem('page_list');
  57. return View::fetch($this->template_dir . 'page_list');
  58. }
  59. public function h5_page_list()
  60. {
  61. return $this->page_list('h5');
  62. }
  63. /**
  64. * 新增页面
  65. */
  66. public function page_add()
  67. {
  68. $editable_page_path = input('param.editable_page_path');
  69. $editable_page_item_id = intval(input('param.editable_page_item_id'));
  70. $editable_page_model = model('editable_page');
  71. if (!request()->isPost()) {
  72. return View::fetch($this->template_dir . 'page_form');
  73. } else {
  74. $data = array(
  75. 'store_id' => $this->store_info['store_id'],
  76. 'editable_page_name' => input('post.editable_page_name'),
  77. 'editable_page_path' => $editable_page_path,
  78. 'editable_page_item_id' => $editable_page_item_id,
  79. 'editable_page_client' => input('param.type', 'pc'),
  80. 'editable_page_theme' => 'style_1',
  81. 'editable_page_edit_time' => TIMESTAMP,
  82. 'editable_page_theme_config' => json_encode(array(
  83. 'back_color' => input('param.back_color')
  84. ))
  85. );
  86. $result = $editable_page_model->addEditablePage($data);
  87. $condition = array();
  88. $condition[] = array('store_id', '=', $data['store_id']);
  89. $condition[] = array('editable_page_id', '<>', $result);
  90. $condition[] = array('editable_page_path', '=', $data['editable_page_path']);
  91. $condition[] = array('editable_page_client', '=', $data['editable_page_client']);
  92. if (!in_array($data['editable_page_path'], array('store/index'))) {
  93. $condition[] = array('editable_page_item_id', '=', $data['editable_page_item_id']);
  94. }
  95. $editable_page_model->editEditablePage($condition, array('editable_page_path' => '', 'editable_page_item_id' => 0));
  96. if ($result) {
  97. $this->recordSellerlog(lang('ds_add') . ($data['editable_page_client'] == 'h5' ? lang('editable_page_h5') : lang('editable_page_pc')) . '[flex_' . $result . ':' . input('post.editable_page_name') . ']');
  98. ds_json_encode(10000, lang('ds_common_op_succ'));
  99. } else {
  100. ds_json_encode(10001, lang('ds_common_op_fail'));
  101. }
  102. }
  103. }
  104. public function page_setting()
  105. {
  106. $editable_page_id = intval(input('param.editable_page_id'));
  107. $editable_page_model = model('editable_page');
  108. $editable_page_info = $editable_page_model->getOneEditablePage(array('editable_page_id' => $editable_page_id));
  109. if (!$editable_page_info) {
  110. $this->error(lang('param_error'));
  111. }
  112. $editable_page_info['editable_page_theme_config'] = json_decode($editable_page_info['editable_page_theme_config'], true);
  113. View::assign('editable_page', $editable_page_info);
  114. $editable_page_config_model = model('editable_page_config');
  115. $editable_page_config_list = $editable_page_config_model->getEditablePageConfigList(array(array('editable_page_id', '=', $editable_page_id)));
  116. $config_list = array();
  117. foreach ($editable_page_config_list as $key => $val) {
  118. $config_info = json_decode($val['editable_page_config_content'], true);
  119. $model_id = $val['editable_page_model_id'];
  120. $var_html = array();
  121. $var_config = array();
  122. if (!empty($config_info)) {
  123. require_once PLUGINS_PATH . '/editable_page_model/' . $model_id . '/config.php';
  124. $model_name = 'Model' . $model_id;
  125. $model = new $model_name();
  126. $res = $model->filterData($config_info);
  127. if ($res['code']) {
  128. $var_config['config_info'] = $res['data'];
  129. $res = $model->formatData(json_encode($res['data']), $this->store_info['store_id']);
  130. if ($res['code']) {
  131. $var_html['config_info'] = $res['data'];
  132. }
  133. }
  134. }
  135. $html = View::fetch('../../../plugins/editable_page_model/' . $model_id . '/index', $var_html);
  136. $config = View::fetch('../../../plugins/editable_page_model/' . $model_id . '/config', $var_config);
  137. $config_list[] = array(
  138. 'val' => $val,
  139. 'html' => $html,
  140. 'config' => $config
  141. );
  142. }
  143. View::assign('config_list', $config_list);
  144. return View::fetch($this->template_dir . 'page_setting');
  145. }
  146. /**
  147. * 设置手机端页面
  148. */
  149. public function mobile_page_setting()
  150. {
  151. $this->type = 'h5';
  152. $editable_page_id = intval(input('param.editable_page_id'));
  153. $editable_page_model = model('editable_page');
  154. $editable_page_info = $editable_page_model->getOneEditablePage(array('editable_page_id' => $editable_page_id));
  155. if (!$editable_page_info) {
  156. $this->error(lang('param_error'));
  157. }
  158. $editable_page_info['editable_page_theme_config'] = json_decode($editable_page_info['editable_page_theme_config'], true);
  159. View::assign('editable_page', $editable_page_info);
  160. $editable_page_config_model = model('editable_page_config');
  161. $editable_page_config_list = $editable_page_config_model->getEditablePageConfigList(array(array('editable_page_id', '=', $editable_page_id)));
  162. $config_list = array();
  163. foreach ($editable_page_config_list as $key => $val) {
  164. $config_info = json_decode($val['editable_page_config_content'], true);
  165. $model_id = $val['editable_page_model_id'];
  166. $var_html = array();
  167. $var_config = array();
  168. if (!empty($config_info)) {
  169. require_once PLUGINS_PATH . '/editable_page_model/h5_' . $model_id . '/config.php';
  170. $model_name = 'Model' . $model_id;
  171. $model = new $model_name();
  172. $res = $model->filterData($config_info);
  173. if ($res['code']) {
  174. $var_config['config_info'] = $res['data'];
  175. $res = $model->formatData(json_encode($res['data']), $this->store_info['store_id']);
  176. if ($res['code']) {
  177. $var_html['config_info'] = $res['data'];
  178. }
  179. }
  180. }
  181. $html = View::fetch('../../../plugins/editable_page_model/h5_' . $model_id . '/index', $var_html);
  182. $config = View::fetch('../../../plugins/editable_page_model/h5_' . $model_id . '/config', $var_config);
  183. $config_list[] = array(
  184. 'val' => $val,
  185. 'html' => $html,
  186. 'config' => $config
  187. );
  188. }
  189. View::assign('store_info', $this->store_info);
  190. View::assign('config_list', $config_list);
  191. /* 设置卖家当前菜单 */
  192. $this->setSellerCurMenu($this->type == 'h5' ? 'seller_editable_page_h5' : 'seller_editable_page_pc');
  193. /* 设置卖家当前栏目 */
  194. $this->setSellerCurItem('mobile_page_setting');
  195. return View::fetch($this->template_dir . 'mobile_page_setting');
  196. }
  197. /**
  198. * 编辑页面
  199. */
  200. public function page_edit()
  201. {
  202. $editable_page_id = intval(input('param.editable_page_id'));
  203. $editable_page_model = model('editable_page');
  204. $editable_page_info = $editable_page_model->getOneEditablePage(array('store_id' => $this->store_info['store_id'], 'editable_page_id' => $editable_page_id));
  205. if (!$editable_page_info) {
  206. ds_json_encode(10001, lang('param_error'));
  207. }
  208. $editable_page_info['editable_page_theme_config'] = json_decode($editable_page_info['editable_page_theme_config'], true);
  209. if (!request()->isPost()) {
  210. View::assign('editable_page', $editable_page_info);
  211. return View::fetch($this->template_dir . 'page_form');
  212. } else {
  213. $data = array(
  214. 'editable_page_path' => input('post.editable_page_path'),
  215. 'editable_page_item_id' => intval(input('post.editable_page_item_id')),
  216. 'editable_page_name' => input('post.editable_page_name'),
  217. 'editable_page_theme_config' => json_encode(array(
  218. 'back_color' => input('param.back_color')
  219. ))
  220. );
  221. $result = $editable_page_model->editEditablePage(array('editable_page_id' => $editable_page_id), $data);
  222. $condition = array();
  223. $condition[] = array('store_id', '=', $this->store_info['store_id']);
  224. $condition[] = array('editable_page_id', '<>', $editable_page_id);
  225. $condition[] = array('editable_page_path', '=', $data['editable_page_path']);
  226. $condition[] = array('editable_page_client', '=', $editable_page_info['editable_page_client']);
  227. if (!in_array($data['editable_page_path'], array('store/index'))) {
  228. $condition[] = array('editable_page_item_id', '=', $data['editable_page_item_id']);
  229. }
  230. $editable_page_model->editEditablePage($condition, array('editable_page_path' => '', 'editable_page_item_id' => 0));
  231. if ($result) {
  232. $this->recordSellerlog(lang('ds_edit') . ($editable_page_info['editable_page_client'] == 'h5' ? lang('editable_page_h5') : lang('editable_page_pc')) . '[' . $editable_page_info['editable_page_name'] . ']');
  233. ds_json_encode(10000, lang('ds_common_op_succ'));
  234. } else {
  235. ds_json_encode(10000, lang('ds_common_op_fail'));
  236. }
  237. }
  238. }
  239. /**
  240. * 删除页面
  241. */
  242. public function page_del()
  243. {
  244. $editable_page_id = intval(input('param.editable_page_id'));
  245. $editable_page_model = model('editable_page');
  246. $editable_page_info = $editable_page_model->getOneEditablePage(array('store_id' => $this->store_info['store_id'], 'editable_page_id' => $editable_page_id));
  247. if (!$editable_page_info) {
  248. ds_json_encode(10001, lang('param_error'));
  249. }
  250. if (!$editable_page_model->delEditablePage($editable_page_id)) {
  251. ds_json_encode(10001, lang('ds_common_op_fail'));
  252. }
  253. $this->recordSellerlog(lang('ds_del') . ($editable_page_info['editable_page_client'] == 'h5' ? lang('editable_page_h5') : lang('editable_page_pc')) . '[ID:' . $editable_page_info['editable_page_id'] . ':' . $editable_page_info['editable_page_name'] . ']');
  254. ds_json_encode(10000, lang('ds_common_del_succ'));
  255. }
  256. /**
  257. * 搜索店铺
  258. */
  259. public function search_store()
  260. {
  261. $store_model = model('store');
  262. /**
  263. * 查询条件
  264. */
  265. $where = array();
  266. $search_store_name = trim(input('param.keyword'));
  267. if ($search_store_name != '') {
  268. $where[] = array('store_name', 'like', '%' . $search_store_name . '%');
  269. }
  270. $store_list = $store_model->getStoreOnlineList($where, 12);
  271. View::assign('store_list', $store_list);
  272. View::assign('show_page', $store_model->page_info->render());
  273. echo View::fetch($this->model_dir . 'search_store');
  274. exit;
  275. }
  276. /**
  277. * 搜索商品
  278. */
  279. public function search_goods()
  280. {
  281. $goods_model = model('goods');
  282. /**
  283. * 查询条件
  284. */
  285. $where = array();
  286. $where[] = array('store_id', '=', $this->store_info['store_id']);
  287. $search_goods_name = trim(input('param.keyword'));
  288. $type = trim(input('param.type'));
  289. if ($search_goods_name != '') {
  290. $where[] = array('goods_name|store_name', 'like', '%' . $search_goods_name . '%');
  291. }
  292. switch ($type) {
  293. case 'bargain':
  294. $condition = array();
  295. $condition[] = array('bargain_state', '=', \app\common\model\Pbargain::PINTUAN_STATE_NORMAL);
  296. $condition[] = array('bargain_endtime', '>', TIMESTAMP);
  297. $subQuery = Db::name('pbargain')->field('bargain_goods_id')->where($condition)->buildSql();
  298. $where[] = array('goods_id', 'exp', Db::raw('in ' . $subQuery));
  299. break;
  300. case 'groupbuy':
  301. $condition = array();
  302. $condition[] = array('groupbuy_state', '=', \app\common\model\Groupbuy::GROUPBUY_STATE_NORMAL);
  303. $condition[] = array('groupbuy_endtime', '>', TIMESTAMP);
  304. $subQuery = Db::name('groupbuy')->field('goods_commonid')->where($condition)->buildSql();
  305. $where[] = array('goods_commonid', 'exp', Db::raw('in ' . $subQuery));
  306. break;
  307. case 'pintuan':
  308. $condition = array();
  309. $condition[] = array('pintuan_state', '=', \app\common\model\Ppintuan::PINTUAN_STATE_NORMAL);
  310. $condition[] = array('pintuan_end_time', '>', TIMESTAMP);
  311. $subQuery = Db::name('ppintuan')->field('pintuan_goods_commonid')->where($condition)->buildSql();
  312. $where[] = array('goods_commonid', 'exp', Db::raw('in ' . $subQuery));
  313. break;
  314. case 'presell':
  315. $condition = array();
  316. $condition[] = array('presell_state', '=', \app\common\model\Presell::PRESELL_STATE_NORMAL);
  317. $condition[] = array('presell_end_time', '>', TIMESTAMP);
  318. $subQuery = Db::name('presell')->field('goods_id')->where($condition)->buildSql();
  319. $where[] = array('goods_id', 'exp', Db::raw('in ' . $subQuery));
  320. break;
  321. case 'xianshi':
  322. $condition = array();
  323. $condition[] = array('xianshigoods_state', '=', \app\common\model\Pxianshigoods::XIANSHI_GOODS_STATE_NORMAL);
  324. $condition[] = array('xianshigoods_end_time', '>', TIMESTAMP);
  325. $subQuery = Db::name('pxianshigoods')->field('goods_id')->where($condition)->buildSql();
  326. $where[] = array('goods_id', 'exp', Db::raw('in ' . $subQuery));
  327. break;
  328. }
  329. $goods_list = $goods_model->getGoodsOnlineList($where, '*', 12);
  330. View::assign('goods_list', $goods_list);
  331. View::assign('show_page', $goods_model->page_info->render());
  332. $goods_id = input('param.goods_id/a');
  333. if (!empty($goods_id)) {
  334. $where = array();
  335. $where[] = array('goods_id', 'in', array_keys($goods_id));
  336. $goods_list = $goods_model->getGoodsOnlineList($where);
  337. $selected_goods = array();
  338. foreach ($goods_list as $v) {
  339. $selected_goods[$v['goods_id']] = array_merge($v, array('sort' => $goods_id[$v['goods_id']]['sort']));
  340. }
  341. View::assign('goods_id', $selected_goods);
  342. }
  343. echo View::fetch($this->template_dir . 'search_goods');
  344. exit;
  345. }
  346. public function image_del()
  347. {
  348. $file_id = intval(input('param.upload_id'));
  349. $res = model('editable_page_model', 'logic')->imageDel($file_id);
  350. if (!$res['code']) {
  351. ds_json_encode(10001, $res['msg']);
  352. }
  353. ds_json_encode(10000);
  354. }
  355. /**
  356. * 图片上传
  357. */
  358. public function image_upload()
  359. {
  360. $res = model('editable_page_model', 'logic')->imageUpload(input('param.name'), input('param.config_id'));
  361. if (!$res['code']) {
  362. ds_json_encode(10001, $res['msg']);
  363. }
  364. $data = $res['data'];
  365. ds_json_encode(10000, '', $data);
  366. }
  367. public function goods_class()
  368. {
  369. $id = intval(input('param.id'));
  370. $parent_id = intval(input('param.parent_id'));
  371. $goodsclass_model = model('goodsclass');
  372. if ($id) {
  373. $data = array('id' => array(), 'list' => array());
  374. $goodsclass_info = $goodsclass_model->getGoodsclassInfoById($id);
  375. if ($goodsclass_info) {
  376. $data['id'][] = $goodsclass_info['gc_id'];
  377. $data['list'][] = $goodsclass_model->getGoodsclassListByParentId($goodsclass_info['gc_parent_id']);
  378. if ($goodsclass_info['gc_parent_id']) {
  379. $goodsclass_info = $goodsclass_model->getGoodsclassInfoById($goodsclass_info['gc_parent_id']);
  380. if ($goodsclass_info) {
  381. $data['id'][] = $goodsclass_info['gc_id'];
  382. $data['list'][] = $goodsclass_model->getGoodsclassListByParentId($goodsclass_info['gc_parent_id']);
  383. if ($goodsclass_info['gc_parent_id']) {
  384. $goodsclass_info = $goodsclass_model->getGoodsclassInfoById($goodsclass_info['gc_parent_id']);
  385. if ($goodsclass_info) {
  386. $data['id'][] = $goodsclass_info['gc_id'];
  387. $data['list'][] = $goodsclass_model->getGoodsclassListByParentId($goodsclass_info['gc_parent_id']);
  388. }
  389. }
  390. }
  391. }
  392. }
  393. $data['id'] = array_reverse($data['id']);
  394. $data['list'] = array_reverse($data['list']);
  395. } else {
  396. $data = $goodsclass_model->getGoodsclassListByParentId($parent_id);
  397. }
  398. ds_json_encode(10000, '', $data);
  399. }
  400. public function config_load()
  401. {
  402. $if_h5 = intval(input('param.if_h5'));
  403. $model_id = intval(input('param.model_id'));
  404. $config_info = input('param.config_info/a');
  405. if (!$model_id) {
  406. ds_json_encode(10001, lang('param_error'));
  407. }
  408. $var_html = array();
  409. $var_config = array();
  410. if (!empty($config_info)) {
  411. require_once PLUGINS_PATH . '/editable_page_model/' . ($if_h5 ? 'h5_' : '') . $model_id . '/config.php';
  412. $model_name = 'Model' . $model_id;
  413. $model = new $model_name();
  414. $res = $model->filterData($config_info);
  415. if ($res['code']) {
  416. $res = $model->formatData(json_encode($res['data']), $this->store_info['store_id']);
  417. if ($res['code']) {
  418. $var_html['config_info'] = $res['data'];
  419. } else {
  420. ds_json_encode(10001, $res['msg']);
  421. }
  422. } else {
  423. ds_json_encode(10001, $res['msg']);
  424. }
  425. }
  426. $html = View::fetch('../../../plugins/editable_page_model/' . ($if_h5 ? 'h5_' : '') . $model_id . '/index', $var_html);
  427. $config = View::fetch('../../../plugins/editable_page_model/' . ($if_h5 ? 'h5_' : '') . $model_id . '/config', $var_config);
  428. ds_json_encode(10000, '', array('html' => $html, 'config' => $config));
  429. }
  430. public function config_edit()
  431. {
  432. $if_h5 = intval(input('param.if_h5'));
  433. $config_list = input('param.config_list/a');
  434. $editable_page_id = intval(input('param.page_id'));
  435. $editable_page_model = model('editable_page');
  436. $editable_page_info = $editable_page_model->getOneEditablePage(array('editable_page_id' => $editable_page_id));
  437. if (!$editable_page_info) {
  438. ds_json_encode(10001, lang('param_error'));
  439. }
  440. try {
  441. $data = array();
  442. $new_data = array();
  443. $editable_page_theme_config = array();
  444. foreach ($config_list as $sort_order => $config_info) {
  445. $model_id = $config_info['model_id'];
  446. switch ($model_id) {
  447. case 'page':
  448. case 'jump':
  449. case 'button':
  450. if ($model_id == 'page') {
  451. $data['editable_page_name'] = $config_info['page_title'];
  452. }
  453. $editable_page_theme_config = array_merge($editable_page_theme_config, $config_info);
  454. break;
  455. default:
  456. require_once PLUGINS_PATH . '/editable_page_model/' . ($if_h5 ? 'h5_' : '') . $model_id . '/config.php';
  457. $model_name = 'Model' . $model_id;
  458. $model = new $model_name();
  459. $res = $model->filterData($config_info);
  460. if ($res['code']) {
  461. $new_data[] = array(
  462. 'editable_page_id' => $editable_page_id,
  463. 'editable_page_model_id' => $model_id,
  464. 'editable_page_config_sort_order' => $sort_order,
  465. 'editable_page_config_content' => json_encode($res['data'])
  466. );
  467. } else {
  468. throw new \think\Exception($res['msg'], 10006);
  469. }
  470. }
  471. }
  472. $data['editable_page_theme_config'] = json_encode($editable_page_theme_config);
  473. $data['editable_page_edit_time'] = TIMESTAMP;
  474. $editable_page_config_model = model('editable_page_config');
  475. $editable_page_config_model->delEditablePageConfig(array(array('editable_page_id', '=', $editable_page_id)));
  476. if (!empty($new_data)) {
  477. $editable_page_config_model->addEditablePageConfigAll($new_data);
  478. }
  479. $result = $editable_page_model->editEditablePage(array('editable_page_id' => $editable_page_id), $data);
  480. if (!$result) {
  481. throw new \think\Exception(lang('ds_common_op_fail'), 10006);
  482. }
  483. } catch (\Exception $e) {
  484. ds_json_encode(10001, $e->getMessage());
  485. }
  486. $this->recordSellerlog(lang('ds_edit') . ($editable_page_info['editable_page_client'] == 'h5' ? lang('editable_page_h5') : lang('editable_page_pc')) . '[' . $editable_page_info['editable_page_name'] . ']');
  487. ds_json_encode(10000, lang('ds_common_op_succ'));
  488. }
  489. /**
  490. * 栏目菜单
  491. */
  492. function getSellerItemList()
  493. {
  494. if (request()->action() == 'mobile_page_setting') {
  495. $menu_array[] = array(
  496. 'name' => 'mobile_page_setting',
  497. 'text' => lang('mobile_page_setting'),
  498. 'url' => 'javascript:void(0)',
  499. );
  500. } else {
  501. $menu_array[] = array(
  502. 'name' => 'page_list',
  503. 'text' => lang('page_list'),
  504. 'url' => 'javascript:void(0)',
  505. );
  506. }
  507. return $menu_array;
  508. }
  509. }