Sellersetting.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\Image;
  5. use think\facade\Lang;
  6. use think\facade\Db;
  7. /**
  8. * ============================================================================
  9. * DSMall多用户商城
  10. * ============================================================================
  11. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  12. * 网站地址: http://www.csdeshang.com
  13. * ----------------------------------------------------------------------------
  14. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  15. * 不允许对程序代码以任何形式任何目的的再发布。
  16. * ============================================================================
  17. * 控制器
  18. */
  19. class Sellersetting extends BaseSeller {
  20. const MAX_MB_SLIDERS = 5;
  21. public function initialize() {
  22. parent::initialize();
  23. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/sellersetting.lang.php');
  24. }
  25. /*
  26. * 店铺设置
  27. */
  28. public function setting() {
  29. /**
  30. * 实例化模型
  31. */
  32. $store_model = model('store');
  33. $store_id = session('store_id'); //当前店铺ID
  34. /**
  35. * 获取店铺信息
  36. */
  37. $store_info = $store_model->getStoreInfoByID($store_id);
  38. $if_miniprocode = $this->getMiniProCode(1);
  39. View::assign('miniprogram_code', $if_miniprocode ? (UPLOAD_SITE_URL . DIRECTORY_SEPARATOR . ATTACH_STORE . DIRECTORY_SEPARATOR . session('store_id') . '/miniprogram_code.png') : '');
  40. /**
  41. * 保存店铺设置
  42. */
  43. if (request()->isPost()) {
  44. /**
  45. * 更新入库
  46. */
  47. $param = array(
  48. 'p_id' => input('post.p_id'),
  49. 'store_vrcode_prefix' => preg_match('/^[a-zA-Z0-9]{1,3}$/', input('post.store_vrcode_prefix')) ? input('post.store_vrcode_prefix') : null,
  50. 'store_qq' => input('post.store_qq'),
  51. 'store_ww' => input('post.store_ww'),
  52. 'store_phone' => input('post.store_phone'),
  53. 'store_mainbusiness' => input('post.store_mainbusiness'),
  54. 'store_keywords' => input('post.seo_keywords'),
  55. 'store_description' => input('post.seo_description'),
  56. 'store_business_time' => input('post.store_business_time')
  57. );
  58. if (!empty(input('post.store_name'))) {
  59. $store = $store_model->getStoreInfo(array('store_name' => input('param.store_name')));
  60. //店铺名存在,则提示错误
  61. if (!empty($store) && ($store_id != $store['store_id'])) {
  62. $this->error(lang('please_change_another_name'));
  63. }
  64. $param['store_name'] = input('post.store_name');
  65. }
  66. //店铺名称修改处理
  67. if (input('param.store_name') != $store_info['store_name'] && !empty(input('post.store_name'))) {
  68. $where = array();
  69. $where[] = array('store_id', '=', $store_id);
  70. $update = array();
  71. $update['store_name'] = input('param.store_name');
  72. Db::name('goodscommon')->where($where)->update($update);
  73. Db::name('goods')->where($where)->update($update);
  74. }
  75. $this->getMiniProCode(1);
  76. $store_model->editStore($param, array('store_id' => $store_id));
  77. $this->success(lang('ds_common_save_succ'), (string) url('Sellersetting/setting'));
  78. }
  79. /**
  80. * 实例化店铺等级模型
  81. */
  82. // 从基类中读取店铺等级信息
  83. $store_grade = $this->store_grade;
  84. /**
  85. * 输出店铺信息
  86. */
  87. /* 设置卖家当前菜单 */
  88. $this->setSellerCurMenu('seller_setting');
  89. /* 设置卖家当前栏目 */
  90. $this->setSellerCurItem('store_setting');
  91. View::assign('store_info', $store_info);
  92. View::assign('store_grade', $store_grade);
  93. $store_list = Db::name('store')->where('p_id',0)->field('store_id,store_name')->select();
  94. View::assign('store_list', $store_list);
  95. /**
  96. * 页面输出
  97. */
  98. return View::fetch($this->template_dir . 'setting');
  99. }
  100. public function getMiniProCode($force = 0) {
  101. if ($force || !file_exists(BASE_UPLOAD_PATH . DIRECTORY_SEPARATOR . ATTACH_STORE . DIRECTORY_SEPARATOR . session('store_id') . '/miniprogram_code.png')) {
  102. $wechat_model = model('wechat');
  103. $wechat_model->getOneWxconfig();
  104. $a = $wechat_model->getMiniProCode(session('store_id'));
  105. if (@imagecreatefromstring($a) == false) {
  106. $a = json_decode($a);
  107. //View::assign('errmsg',$a->errmsg);
  108. } else {
  109. if (is_dir(BASE_UPLOAD_PATH . DIRECTORY_SEPARATOR . ATTACH_STORE . DIRECTORY_SEPARATOR . session('store_id')) || (!is_dir(BASE_UPLOAD_PATH . DIRECTORY_SEPARATOR . ATTACH_STORE . DIRECTORY_SEPARATOR . session('store_id')) && mkdir(BASE_UPLOAD_PATH . DIRECTORY_SEPARATOR . ATTACH_STORE . DIRECTORY_SEPARATOR . session('store_id'), 0755, true))) {
  110. file_put_contents(BASE_UPLOAD_PATH . DIRECTORY_SEPARATOR . ATTACH_STORE . DIRECTORY_SEPARATOR . session('store_id') . '/miniprogram_code.png', $a);
  111. return true;
  112. } else {
  113. //View::assign('errmsg','没有权限生成目录');
  114. }
  115. }
  116. } else {
  117. return true;
  118. }
  119. return false;
  120. }
  121. public function store_image_upload() {
  122. $store_id = session('store_id');
  123. $upload_file = BASE_UPLOAD_PATH . DIRECTORY_SEPARATOR . ATTACH_STORE . DIRECTORY_SEPARATOR . $store_id;
  124. $file_name = session('store_id') . '_' . date('YmdHis') . rand(10000, 99999) . '.png';
  125. $store_image_name = input('param.id');
  126. if (!in_array($store_image_name, array('store_logo', 'store_banner', 'store_avatar'))) {
  127. exit;
  128. }
  129. if (!empty($_FILES[$store_image_name]['name'])) {
  130. $res = ds_upload_pic(ATTACH_STORE . DIRECTORY_SEPARATOR . $store_id, $store_image_name, $file_name);
  131. if ($res['code']) {
  132. $file_name = $res['data']['file_name'];
  133. if(file_exists($upload_file . DIRECTORY_SEPARATOR . $file_name)){
  134. /* 处理图片 */
  135. $image = Image::open($upload_file . DIRECTORY_SEPARATOR . $file_name);
  136. switch ($store_image_name) {
  137. case 'store_logo':
  138. $image->thumb(200, 60, \think\Image::THUMB_CENTER)->save($upload_file . DIRECTORY_SEPARATOR . $file_name);
  139. break;
  140. case 'store_banner':
  141. $image->thumb(1920, 150, \think\Image::THUMB_CENTER)->save($upload_file . DIRECTORY_SEPARATOR . $file_name);
  142. break;
  143. case 'store_avatar':
  144. $image->thumb(100, 100, \think\Image::THUMB_CENTER)->save($upload_file . DIRECTORY_SEPARATOR . $file_name);
  145. break;
  146. default:
  147. break;
  148. }
  149. }
  150. } else {
  151. json_encode(array('error' => $res['msg']));
  152. exit;
  153. }
  154. }
  155. $store_model = model('store');
  156. //删除原图
  157. $store_info = $store_model->getStoreInfoByID($store_id);
  158. @unlink($upload_file . DIRECTORY_SEPARATOR . $store_info[$store_image_name]);
  159. $result = $store_model->editStore(array($store_image_name => $file_name), array('store_id' => $store_id));
  160. if ($result) {
  161. $data = array();
  162. $data['file_name'] = $file_name;
  163. $data['file_path'] = ds_get_pic( ATTACH_STORE . '/' . $store_id , $file_name);
  164. /**
  165. * 整理为json格式
  166. */
  167. $output = json_encode($data);
  168. echo $output;
  169. exit;
  170. }
  171. }
  172. /**
  173. * 店铺幻灯片
  174. */
  175. public function store_slide() {
  176. /**
  177. * 模型实例化
  178. */
  179. $store_model = model('store');
  180. $upload_model = model('upload');
  181. /**
  182. * 保存店铺信息
  183. */
  184. if (request()->isPost()) {
  185. // 更新店铺信息
  186. $update = array();
  187. $update['store_slide'] = implode(',', input('post.image_path/a'));
  188. $update['store_slide_url'] = implode(',', input('post.image_url/a'));
  189. $store_model->editStore($update, array('store_id' => session('store_id')));
  190. // 删除upload表中数据
  191. $upload_model->delUpload(array('upload_type' => 3, 'item_id' => session('store_id')));
  192. ds_json_encode(10000, lang('ds_common_save_succ'));
  193. } else {
  194. // 删除upload中的无用数据
  195. $upload_info = $upload_model->getUploadList(array('upload_type' => 3, 'item_id' => session('store_id')), 'file_name');
  196. if (is_array($upload_info) && !empty($upload_info)) {
  197. foreach ($upload_info as $val) {
  198. @unlink(BASE_UPLOAD_PATH . DIRECTORY_SEPARATOR . ATTACH_SLIDE . DIRECTORY_SEPARATOR . $val['file_name']);
  199. }
  200. }
  201. $upload_model->delUpload(array('upload_type' => 3, 'item_id' => session('store_id')));
  202. $store_info = $store_model->getStoreInfoByID(session('store_id'));
  203. if ($store_info['store_slide'] != '' && $store_info['store_slide'] != ',,,,') {
  204. View::assign('store_slide', explode(',', $store_info['store_slide']));
  205. View::assign('store_slide_url', explode(',', $store_info['store_slide_url']));
  206. }
  207. $this->setSellerCurMenu('seller_setting');
  208. /* 设置卖家当前栏目 */
  209. $this->setSellerCurItem('store_slide');
  210. return View::fetch($this->template_dir . 'slide');
  211. }
  212. }
  213. /**
  214. * 店铺幻灯片ajax上传
  215. */
  216. public function silde_image_upload() {
  217. $file_id = intval(input('param.file_id'));
  218. $id = input('param.id');
  219. if ($file_id < 0 || empty($id)) {
  220. return;
  221. }
  222. $file_name = session('store_id') . '_' . $file_id . '.png';
  223. $res = ds_upload_pic(ATTACH_SLIDE, $id, $file_name);
  224. if ($res['code']) {
  225. $file_name = $res['data']['file_name'];
  226. $img_path = $file_name;
  227. $output['file_id'] = $file_id;
  228. $output['id'] = $id;
  229. $output['file_name'] = $img_path;
  230. $output['file_url'] = ds_get_pic(ATTACH_SLIDE, $img_path);
  231. echo json_encode($output);
  232. exit;
  233. } else {
  234. json_encode(array('error' => $res['msg']));
  235. exit;
  236. }
  237. }
  238. /**
  239. * ajax删除幻灯片图片
  240. */
  241. public function dorp_img() {
  242. $file_id = intval(input('param.file_id'));
  243. $img_src = input('param.img_src');
  244. if ($file_id < 0 || empty($img_src)) {
  245. return;
  246. }
  247. $ext = strrchr($img_src, '.');
  248. $file_name = session('store_id') . '_' . $file_id . $ext;
  249. @unlink(BASE_UPLOAD_PATH . DIRECTORY_SEPARATOR . ATTACH_SLIDE . DIRECTORY_SEPARATOR . $file_name);
  250. echo json_encode(array('succeed' => lang('ds_common_save_succ')));
  251. die;
  252. }
  253. /**
  254. * 卖家店铺主题设置
  255. *
  256. * @param string
  257. * @param string
  258. * @return
  259. */
  260. public function theme() {
  261. /**
  262. * 店铺信息
  263. */
  264. $store_class = model('store');
  265. $store_info = $store_class->getStoreInfoByID(session('store_id'));
  266. /**
  267. * 主题配置信息
  268. */
  269. $style_data = array();
  270. $style_configurl = PUBLIC_PATH . '/static/home/default/store/styles/' . "styleconfig.php";
  271. if (file_exists($style_configurl)) {
  272. include_once($style_configurl);
  273. }
  274. /**
  275. * 当前店铺主题
  276. */
  277. $curr_store_theme = !empty($store_info['store_theme']) ? $store_info['store_theme'] : 'default';
  278. /**
  279. * 当前店铺预览图片
  280. */
  281. $curr_image = BASE_SITE_ROOT . '/static/home/default/store/styles/' . $curr_store_theme . '/images/preview.jpg';
  282. $curr_theme = array(
  283. 'curr_name' => $curr_store_theme,
  284. 'curr_truename' => $style_data[$curr_store_theme]['truename'],
  285. 'curr_image' => $curr_image
  286. );
  287. // 自营店全部可用
  288. if (check_platform_store()) {
  289. $themes = array_keys($style_data);
  290. } else {
  291. /**
  292. * 店铺等级
  293. */
  294. $grade_class = model('storegrade');
  295. $grade = $grade_class->getOneStoregrade($store_info['grade_id']);
  296. /**
  297. * 可用主题
  298. */
  299. $themes = explode('|', $grade['storegrade_template']);
  300. }
  301. $theme_list = array();
  302. /**
  303. * 可用主题预览图片
  304. */
  305. foreach ($style_data as $key => $val) {
  306. if (in_array($key, $themes)) {
  307. $theme_list[$key] = array(
  308. 'name' => $key, 'truename' => $val['truename'],
  309. 'image' => BASE_SITE_ROOT . '/static/home/default/store/styles/' . $key . '/images/preview.jpg'
  310. );
  311. }
  312. }
  313. /**
  314. * 页面输出
  315. */
  316. $this->setSellerCurMenu('seller_setting');
  317. $this->setSellerCurItem('store_theme');
  318. View::assign('store_info', $store_info);
  319. View::assign('curr_theme', $curr_theme);
  320. View::assign('theme_list', $theme_list);
  321. return View::fetch($this->template_dir . 'theme');
  322. }
  323. /**
  324. * 卖家店铺主题设置
  325. *
  326. * @param string
  327. * @param string
  328. * @return
  329. */
  330. public function set_theme() {
  331. //读取语言包
  332. $style = input('param.style_name');
  333. $style = isset($style) ? trim($style) : null;
  334. if (!empty($style) && file_exists(PUBLIC_PATH . '/static/home/default/store/styles/theme/' . $style . '/images/preview.jpg')) {
  335. $store_class = model('store');
  336. $rs = $store_class->editStore(array('store_theme' => $style), array('store_id' => session('store_id')));
  337. ds_json_encode(10000, lang('store_theme_congfig_success'));
  338. } else {
  339. ds_json_encode(10001, lang('store_theme_congfig_fail'));
  340. }
  341. }
  342. protected function getStoreMbSliders() {
  343. $store_info = model('store')->getStoreInfoByID(session('store_id'));
  344. $mbSliders = @unserialize($store_info['mb_sliders']);
  345. if (!$mbSliders) {
  346. $mbSliders = array_fill(1, self::MAX_MB_SLIDERS, array(
  347. 'img' => '', 'type' => 1, 'link' => '',
  348. ));
  349. }
  350. return $mbSliders;
  351. }
  352. protected function setStoreMbSliders(array $mbSliders) {
  353. return model('store')->editStore(array(
  354. 'mb_sliders' => serialize($mbSliders),
  355. ), array(
  356. 'store_id' => session('store_id'),
  357. ));
  358. }
  359. public function store_mb_sliders() {
  360. //上传文件名称
  361. $fileName = input('param.id');
  362. //文件ID
  363. $file_id = intval(input('param.file_id'));
  364. if (!preg_match('/^file_(\d+)$/', $fileName, $fileIndex) || empty($_FILES[$fileName]['name'])) {
  365. echo json_encode(array('error' => lang('param_error')));
  366. exit;
  367. }
  368. $fileIndex = (int) $fileIndex[1];
  369. if ($fileIndex < 1 || $fileIndex > self::MAX_MB_SLIDERS) {
  370. echo json_encode(array('error' => lang('param_error')));
  371. exit;
  372. }
  373. $mbSliders = $this->getStoreMbSliders();
  374. $file_name = session('store_id') . '_' . $file_id . '.png';
  375. $res = ds_upload_pic(ATTACH_STORE . DIRECTORY_SEPARATOR . 'mobileslide', $fileName, $file_name);
  376. if ($res['code']) {
  377. $file_name = $res['data']['file_name'];
  378. $newImg = $file_name;
  379. $oldImg = $mbSliders[$fileIndex]['img'];
  380. $mbSliders[$fileIndex]['img'] = $newImg;
  381. //即时更新
  382. $this->setStoreMbSliders($mbSliders);
  383. if ($oldImg && file_exists($oldImg)) {
  384. unlink($oldImg);
  385. }
  386. echo json_encode(array(
  387. 'uploadedUrl' => ds_get_pic( ATTACH_STORE . DIRECTORY_SEPARATOR . 'mobileslide' , $newImg),
  388. ));
  389. exit;
  390. } else {
  391. echo json_encode(array('error' => $res['msg']));
  392. exit;
  393. }
  394. }
  395. public function store_mb_sliders_drop() {
  396. try {
  397. $id = (int) $_REQUEST['id'];
  398. if ($id < 1 || $id > self::MAX_MB_SLIDERS) {
  399. throw new \think\Exception(lang('param_error'), 10006);
  400. }
  401. $mbSliders = $this->getStoreMbSliders();
  402. $mbSliders[$id]['img'] = '';
  403. if (!$this->setStoreMbSliders($mbSliders)) {
  404. throw new \think\Exception(lang('update_failed'), 10006);
  405. }
  406. echo json_encode(array(
  407. 'success' => true,
  408. ));
  409. } catch (\Exception $ex) {
  410. echo json_encode(array(
  411. 'success' => false, 'error' => $ex->getMessage(),
  412. ));
  413. }
  414. }
  415. public function store_mobile() {
  416. View::assign('max_mb_sliders', self::MAX_MB_SLIDERS);
  417. $store_info = model('store')->getStoreInfoByID(session('store_id'));
  418. // 页头背景图
  419. $mb_title_img = $store_info['mb_title_img'] ? ds_get_pic( ATTACH_STORE , $store_info['mb_title_img']) : '';
  420. // 轮播
  421. $mbSliders = $this->getStoreMbSliders();
  422. if (request()->isPost()) {
  423. $update_array = array();
  424. if ($mb_title_img_del = !empty(input('post.mb_title_img_del'))) {
  425. $update_array['mb_title_img'] = '';
  426. }
  427. if (!empty($_FILES['mb_title_img']['name'])) {
  428. $file_name = session('store_id') . '_' . date('YmdHis') . rand(10000, 99999) . '.png';
  429. $res=ds_upload_pic(ATTACH_STORE,'mb_title_img');
  430. if($res['code']){
  431. $file_name=$res['data']['file_name'];
  432. $mb_title_img_del = true;
  433. $update_array['mb_title_img'] = $file_name;
  434. }else{
  435. $this->error($res['msg']);
  436. }
  437. }
  438. if ($mb_title_img_del && $mb_title_img && file_exists($mb_title_img)) {
  439. unlink($mb_title_img);
  440. }
  441. // mb_sliders
  442. $skuToValid = array();
  443. $mb_sliders_links_array = input('post.mb_sliders_links/a'); #获取数组
  444. $mb_sliders_type_array = input('post.mb_sliders_type/a'); #获取数组
  445. $mb_sliders_sort_array = input('post.mb_sliders_sort/a'); #获取数组
  446. foreach ($mb_sliders_links_array as $k => $v) {
  447. if ($k < 1 || $k > self::MAX_MB_SLIDERS) {
  448. $this->error(lang('param_error'));
  449. }
  450. $type = intval($mb_sliders_type_array[$k]);
  451. switch ($type) {
  452. case 1:
  453. // 链接URL
  454. $v = (string) $v;
  455. if (!preg_match('#^https?://#', $v)) {
  456. $v = '';
  457. }
  458. break;
  459. case 2:
  460. // 商品ID
  461. $v = (int) $v;
  462. if ($v < 1) {
  463. $v = '';
  464. } else {
  465. $skuToValid[$k] = $v;
  466. }
  467. break;
  468. default:
  469. $type = 1;
  470. $v = '';
  471. break;
  472. }
  473. $mbSliders[$k]['type'] = $type;
  474. $mbSliders[$k]['link'] = $v;
  475. }
  476. if ($skuToValid) {
  477. $condition = array();
  478. $condition[] = array('goods_id', 'in', $skuToValid);
  479. $condition[] = array('store_id', '=', session('store_id'));
  480. $validSkus = model('goods')->getGoodsList($condition);
  481. if (!empty($validSkus)) {
  482. $validSkus = ds_change_arraykey($validSkus, 'goods_id');
  483. }
  484. foreach ($skuToValid as $k => $v) {
  485. if (!isset($validSkus[$v])) {
  486. $mbSliders[$k]['link'] = '';
  487. }
  488. }
  489. }
  490. // sort
  491. for ($i = 0; $i < self::MAX_MB_SLIDERS; $i++) {
  492. $sortedMbSliders[$i + 1] = @$mbSliders[$mb_sliders_sort_array[$i]];
  493. }
  494. $update_array['mb_sliders'] = serialize($sortedMbSliders);
  495. model('store')->editStore($update_array, array(
  496. 'store_id' => session('store_id'),
  497. ));
  498. $this->success(lang('save_success'), (string) url('Sellersetting/store_mobile'));
  499. }
  500. $mbSliderUrls = array();
  501. foreach ($mbSliders as $v) {
  502. if ($v['img']) {
  503. $mbSliderUrls[] = ds_get_pic( ATTACH_STORE . DIRECTORY_SEPARATOR . 'mobileslide' , $v['img']);
  504. }
  505. }
  506. View::assign('mb_title_img', $mb_title_img);
  507. View::assign('mbSliders', $mbSliders);
  508. View::assign('mbSliderUrls', $mbSliderUrls);
  509. $this->setSellerCurMenu('seller_setting');
  510. $this->setSellerCurItem('store_mobile');
  511. return View::fetch($this->template_dir . 'store_mobile');
  512. }
  513. public function map() {
  514. $this->setSellerCurMenu('seller_setting');
  515. $this->setSellerCurItem('store_map');
  516. /**
  517. * 实例化模型
  518. */
  519. $store_model = model('store');
  520. $store_id = session('store_id'); //当前店铺ID
  521. /**
  522. * 获取店铺信息
  523. */
  524. $store_info = $store_model->getStoreInfoByID($store_id);
  525. /**
  526. * 保存店铺设置
  527. */
  528. if (request()->isPost()) {
  529. model('store')->editStore(array(
  530. 'store_address' => input('post.company_address_detail'),
  531. 'region_id' => input('post.district_id') ? input('post.district_id') : (input('post.city_id') ? input('post.city_id') : (input('post.province_id') ? input('post.province_id') : 0)),
  532. 'area_info' => input('post.company_address'),
  533. 'store_longitude' => input('post.longitude'),
  534. 'store_latitude' => input('post.latitude')
  535. ), array(
  536. 'store_id' => session('store_id'),
  537. ));
  538. $this->success(lang('save_success'), (string) url('Sellersetting/map'));
  539. }
  540. View::assign('store_info', $store_info);
  541. View::assign('baidu_ak', config('ds_config.baidu_ak'));
  542. return View::fetch($this->template_dir . 'map');
  543. }
  544. /**
  545. * 用户中心右边,小导航
  546. *
  547. * @param string $menu_type 导航类型
  548. * @param string $name 当前导航的name
  549. * @return
  550. */
  551. protected function getSellerItemList() {
  552. $menu_array = array(
  553. 1 => array(
  554. 'name' => 'store_setting', 'text' => lang('ds_member_path_store_config'),
  555. 'url' => (string) url('Sellersetting/setting')
  556. ),
  557. 2 => array(
  558. 'name' => 'store_map', 'text' => lang('ds_member_path_store_map'),
  559. 'url' => (string) url('Sellersetting/map')
  560. ),
  561. 4 => array(
  562. 'name' => 'store_slide', 'text' => lang('ds_member_path_store_slide'),
  563. 'url' => (string) url('Sellersetting/store_slide')
  564. ), 5 => array(
  565. 'name' => 'store_theme', 'text' => lang('store_theme'), 'url' => (string) url('Sellersetting/theme')
  566. ),
  567. 7 => array(
  568. 'name' => 'store_mobile', 'text' => lang('mobile_phone_store_settings'), 'url' => (string) url('Sellersetting/store_mobile'),
  569. ),
  570. );
  571. return $menu_array;
  572. }
  573. }
  574. ?>