Store.php 47 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116
  1. <?php
  2. namespace app\admin\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. use app\common\model\Storedepositlog;
  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 Store extends AdminControl {
  20. public function initialize() {
  21. parent::initialize();
  22. Lang::load(base_path() . 'admin/lang/' . config('lang.default_lang') . '/store.lang.php');
  23. }
  24. /**
  25. * 店铺
  26. */
  27. public function store() {
  28. $store_model = model('store');
  29. $owner_and_name = input('get.owner_and_name');
  30. if (trim($owner_and_name) != '') {
  31. $condition[] = array('member_name', 'like', '%' . $owner_and_name . '%');
  32. }
  33. $store_name = input('get.store_name');
  34. if (trim($store_name) != '') {
  35. $condition[] = array('store_name', 'like', '%' . trim($store_name) . '%');
  36. }
  37. $grade_id = input('get.grade_id');
  38. if (intval($grade_id) > 0) {
  39. $condition[] = array('grade_id', '=', intval($grade_id));
  40. }
  41. $store_state = input('get.store_state');
  42. switch ($store_state) {
  43. case 'close':
  44. $condition[] = array('store_state', '=', 0);
  45. break;
  46. case 'open':
  47. $condition[] = array('store_state', '=', 1);
  48. break;
  49. case 'expired':
  50. $condition[] = array('store_endtime', 'between', array(1, TIMESTAMP));
  51. $condition[] = array('store_state', '=', 1);
  52. break;
  53. case 'expire':
  54. $condition[] = array('store_endtime', 'between', array(TIMESTAMP, TIMESTAMP + 864000));
  55. $condition[] = array('store_state', '=', 1);
  56. break;
  57. }
  58. // 默认店铺管理不包含自营店铺
  59. $condition[] = array('is_platform_store', '=', 0);
  60. //店铺列表
  61. $store_list = $store_model->getStoreList($condition, 10, 'store_id desc');
  62. //店铺等级
  63. $storegrade_model = model('storegrade');
  64. $grade_list = $storegrade_model->getStoregradeList();
  65. $search_grade_list = array();
  66. if (!empty($grade_list)) {
  67. $search_grade_list[0] = lang('no_select_grade');
  68. foreach ($grade_list as $k => $v) {
  69. $search_grade_list[$v['storegrade_id']] = $v['storegrade_name'];
  70. }
  71. }
  72. View::assign('search_grade_list', $search_grade_list);
  73. View::assign('grade_list', $grade_list);
  74. View::assign('store_list', $store_list);
  75. View::assign('store_state_list', $this->_get_store_state_array());
  76. View::assign('show_page', $store_model->page_info->render());
  77. $this->setAdminCurItem('store');
  78. return View::fetch('store');
  79. }
  80. private function _get_store_state_array() {
  81. return array(
  82. 'open' => lang('ds_open'),
  83. 'close' => lang('ds_close'),
  84. 'expire' => lang('about_to_expire'),
  85. 'expired' => lang('has_expired')
  86. );
  87. }
  88. /**
  89. * 店铺编辑
  90. */
  91. public function store_edit() {
  92. $store_id = input('param.store_id');
  93. $store_model = model('store');
  94. //取店铺信息
  95. $store_array = $store_model->getStoreInfoByID($store_id);
  96. if (empty($store_array)) {
  97. $this->error(lang('store_no_exist'));
  98. }
  99. //保存
  100. if (!request()->isPost()) {
  101. //整理店铺内容
  102. $store_array['store_endtime'] = $store_array['store_endtime'] ? date('Y-m-d', $store_array['store_endtime']) : '';
  103. //店铺分类
  104. $storeclass_model = model('storeclass');
  105. $parent_list = $storeclass_model->getStoreclassList(array(), '', false);
  106. //店铺等级
  107. $storegrade_model = model('storegrade');
  108. $grade_list = $storegrade_model->getStoregradeList();
  109. View::assign('grade_list', $grade_list);
  110. View::assign('class_list', $parent_list);
  111. View::assign('store_array', $store_array);
  112. $joinin_detail = model('storejoinin')->getOneStorejoinin(array('member_id' => $store_array['member_id']));
  113. View::assign('joinin_detail', $joinin_detail);
  114. $this->setAdminCurItem('store_edit');
  115. return View::fetch('store_edit');
  116. } else {
  117. //取店铺等级的审核
  118. $storegrade_model = model('storegrade');
  119. $grade_array = $storegrade_model->getOneStoregrade(intval(input('post.grade_id')));
  120. if (empty($grade_array)) {
  121. $this->error(lang('please_input_store_level'));
  122. }
  123. //结束时间
  124. $time = '';
  125. if (trim(input('post.end_time')) != '') {
  126. $time = strtotime(input('post.end_time'));
  127. }
  128. $update_array = array();
  129. $update_array['store_name'] = trim(input('post.store_name'));
  130. $update_array['storeclass_id'] = intval(input('post.storeclass_id'));
  131. $update_array['grade_id'] = intval(input('post.grade_id'));
  132. $update_array['store_endtime'] = $time;
  133. $update_array['store_state'] = intval(input('post.store_state'));
  134. $update_array['store_baozh'] = trim(input('post.store_baozh')); //保障服务开关
  135. $update_array['store_qtian'] = trim(input('post.store_qtian')); //保障服务-七天退换
  136. $update_array['store_zhping'] = trim(input('post.store_zhping')); //保障服务-正品保证
  137. $update_array['store_erxiaoshi'] = trim(input('post.store_erxiaoshi')); //保障服务-两小时发货
  138. $update_array['store_tuihuo'] = trim(input('post.store_tuihuo')); //保障服务-退货承诺
  139. $update_array['store_shiyong'] = trim(input('post.store_shiyong')); //保障服务-试用
  140. $update_array['store_xiaoxie'] = trim(input('post.store_xiaoxie')); //保障服务-消协
  141. $update_array['store_huodaofk'] = trim(input('post.store_huodaofk')); //保障服务-货到付款
  142. $update_array['store_shiti'] = trim(input('post.store_shiti')); //保障服务-实体店铺
  143. $update_array['is_arrive'] = input('post.is_arrive') == 1 ? 1 : 0; //到店付款
  144. $data['store_type'] = input('post.store_type') == 1 ? 1 : 0;
  145. $condition = array();
  146. $condition[] = array('member_id', '=', intval(input('post.member_id')));
  147. if ($update_array['store_state'] == 0) {
  148. //根据店铺状态修改该店铺所有商品状态
  149. $goods_model = model('goods');
  150. $goods_model->editProducesOffline(array(array('store_id', '=', $store_id)));
  151. $update_array['store_close_info'] = trim(input('post.store_close_info'));
  152. $update_array['store_recommend'] = 0;
  153. } else {
  154. //店铺开启后商品不在自动上架,需要手动操作
  155. $update_array['store_close_info'] = '';
  156. }
  157. if ($update_array['store_name'] != $store_array['store_name']) {
  158. $goods_model = model('goods');
  159. $goods_model->editGoodsCommon(array('store_name' => $update_array['store_name']), array('store_id' => $store_id));
  160. $goods_model->editGoods(array('store_name' => $update_array['store_name']), array('store_id' => $store_id));
  161. }
  162. $result = $store_model->editStore($update_array, array('store_id' => $store_id));
  163. $store_type = model('Storejoinin')->editStorejoinin($data, $condition);
  164. if ($result || $store_type) {
  165. //店铺名称修改处理
  166. $store_name = trim(input('post.store_name'));
  167. $store_info = $store_model->getStoreInfoByID($store_id);
  168. if (!empty($store_name)) {
  169. $condition = array();
  170. $condition[] = array('store_id', '=', $store_id);
  171. $update = array();
  172. $update['store_name'] = $store_name;
  173. $bllGoods = $store_model->editGoodscommon($condition, $update);
  174. $bllGoods = $store_model->editGoods($condition, $update);
  175. }
  176. $this->log(lang('ds_edit') . lang('ds_store') . '[' . input('post.store_name') . ']', 1);
  177. $this->success(lang('ds_common_save_succ'), (string) url('Store/store'));
  178. } else {
  179. $this->log(lang('ds_edit') . lang('ds_store') . '[' . input('post.store_name') . ']', 1);
  180. $this->error(lang('ds_common_save_fail'));
  181. }
  182. }
  183. }
  184. /**
  185. * 编辑保存注册信息
  186. */
  187. public function edit_save_joinin() {
  188. if (request()->isPost()) {
  189. $member_id = input('post.member_id');
  190. if ($member_id <= 0) {
  191. $this->error(lang('param_error'));
  192. }
  193. $param = array();
  194. $param['company_name'] = input('post.company_name');
  195. $param['company_province_id'] = intval(input('post.province_id'));
  196. $param['company_address'] = input('post.company_address');
  197. $param['company_address_detail'] = input('post.company_address_detail');
  198. $param['company_registered_capital'] = intval(input('post.company_registered_capital'));
  199. $param['contacts_name'] = input('post.contacts_name');
  200. $param['contacts_phone'] = input('post.contacts_phone');
  201. $param['contacts_email'] = input('post.contacts_email');
  202. $param['business_licence_number'] = input('post.business_licence_number');
  203. $param['business_licence_address'] = input('post.business_licence_address');
  204. $param['business_licence_start'] = input('post.business_licence_start');
  205. $param['business_licence_end'] = input('post.business_licence_end');
  206. $param['business_sphere'] = input('post.business_sphere');
  207. if (!empty($_FILES['business_licence_number_electronic']['name'])) {
  208. $param['business_licence_number_electronic'] = $this->upload_image('business_licence_number_electronic');
  209. }
  210. $param['bank_account_name'] = input('post.bank_account_name');
  211. $param['bank_account_number'] = input('post.bank_account_number');
  212. $param['bank_name'] = input('post.bank_name');
  213. $param['bank_address'] = input('post.bank_address');
  214. $param['settlement_bank_account_name'] = input('post.settlement_bank_account_name');
  215. $param['settlement_bank_account_number'] = input('post.settlement_bank_account_number');
  216. $param['settlement_bank_name'] = input('post.settlement_bank_name');
  217. $param['settlement_bank_address'] = input('post.settlement_bank_address');
  218. $result = model('storejoinin')->editStorejoinin($param, array('member_id' => $member_id));
  219. if ($result >= 0) {
  220. //更新店铺信息
  221. $store_update = array();
  222. $store_update['store_company_name'] = $param['company_name'];
  223. $store_update['area_info'] = $param['company_address'];
  224. $store_update['store_address'] = $param['company_address_detail'];
  225. $store_model = model('store');
  226. $store_info = $store_model->getStoreInfo(array('member_id' => $member_id));
  227. if (!empty($store_info)) {
  228. $r = $store_model->editStore($store_update, array('member_id' => $member_id));
  229. $this->log('编辑店铺信息' . '[ID:' . $r . ']', 1);
  230. }
  231. $this->success(lang('ds_common_op_succ'), (string) url('Store/store'));
  232. } else {
  233. $this->error(lang('ds_common_op_fail'));
  234. }
  235. }
  236. }
  237. private function upload_image($file) {
  238. //上传文件保存路径
  239. $pic_name = '';
  240. if (!empty($_FILES[$file]['name'])) {
  241. //设置特殊图片名称
  242. $member_id = input('post.member_id');
  243. $file_name = $member_id . '_' . date('YmdHis') . rand(10000, 99999) . '.png';
  244. $res = ds_upload_pic('home' . DIRECTORY_SEPARATOR . 'store_joinin', $file, $file_name);
  245. if ($res['code']) {
  246. $pic_name = $res['data']['file_name'];
  247. } else {
  248. $this->error($res['msg']);
  249. }
  250. }
  251. return $pic_name;
  252. }
  253. /**
  254. * 店铺经营类目管理
  255. */
  256. public function store_bind_class() {
  257. $store_id = intval(input('param.store_id'));
  258. $store_model = model('store');
  259. $storebindclass_model = model('storebindclass');
  260. $goodsclass_model = model('goodsclass');
  261. $gc_list = $goodsclass_model->getGoodsclassListByParentId(0);
  262. View::assign('gc_list', $gc_list);
  263. $store_info = $store_model->getStoreInfoByID($store_id);
  264. if (empty($store_info)) {
  265. $this->error(lang('param_error'));
  266. }
  267. View::assign('store_info', $store_info);
  268. $store_bind_class_list = $storebindclass_model->getStorebindclassList(array(array('store_id', '=', $store_id), array('storebindclass_state', 'in', array(1, 2))), null);
  269. $goods_class = model('goodsclass')->getGoodsclassIndexedListAll();
  270. for ($i = 0, $j = count($store_bind_class_list); $i < $j; $i++) {
  271. $store_bind_class_list[$i]['class_1_name'] = @$goods_class[$store_bind_class_list[$i]['class_1']]['gc_name'];
  272. $store_bind_class_list[$i]['class_2_name'] = @$goods_class[$store_bind_class_list[$i]['class_2']]['gc_name'];
  273. $store_bind_class_list[$i]['class_3_name'] = @$goods_class[$store_bind_class_list[$i]['class_3']]['gc_name'];
  274. }
  275. View::assign('store_bind_class_list', $store_bind_class_list);
  276. $this->setAdminCurItem('store_bind_class');
  277. return View::fetch('store_bind_class');
  278. }
  279. /**
  280. * 添加经营类目
  281. */
  282. public function store_bind_class_add() {
  283. $store_id = intval(input('post.store_id'));
  284. $commis_rate = intval(input('post.commis_rate'));
  285. if ($commis_rate < 0 || $commis_rate > 100) {
  286. $this->error(lang('param_error'));
  287. }
  288. @list($class_1, $class_2, $class_3) = explode(',', input('post.goods_class'));
  289. $storebindclass_model = model('storebindclass');
  290. $param = array();
  291. $param['store_id'] = $store_id;
  292. $param['class_1'] = $class_1;
  293. $param['storebindclass_state'] = 1;
  294. if (!empty($class_2)) {
  295. $param['class_2'] = $class_2;
  296. }
  297. if (!empty($class_3)) {
  298. $param['class_3'] = $class_3;
  299. }
  300. // 检查类目是否已经存在
  301. $store_bind_class_info = $storebindclass_model->getStorebindclassInfo($param);
  302. if (!empty($store_bind_class_info)) {
  303. $this->error(lang('storeclass_has_exist'));
  304. }
  305. $param['commis_rate'] = $commis_rate;
  306. $result = $storebindclass_model->addStorebindclass($param);
  307. if ($result) {
  308. $this->log('新增店铺经营类目,类目编号:' . $result . ',店铺编号:' . $store_id);
  309. $this->success(lang('ds_common_save_succ'));
  310. } else {
  311. $this->error(lang('ds_common_save_fail'));
  312. }
  313. }
  314. /**
  315. * 删除经营类目
  316. */
  317. public function store_bind_class_del() {
  318. $bid = intval(input('param.bid'));
  319. $storebindclass_model = model('storebindclass');
  320. $goods_model = model('goods');
  321. $store_bind_class_info = $storebindclass_model->getStorebindclassInfo(array('storebindclass_id' => $bid));
  322. if (empty($store_bind_class_info)) {
  323. ds_json_encode('10001', lang('ds_common_del_fail'));
  324. }
  325. // 商品下架
  326. $condition = array();
  327. $condition[] = array('store_id', '=', $store_bind_class_info['store_id']);
  328. $gc_id = $store_bind_class_info['class_1'] . ',' . $store_bind_class_info['class_2'] . ',' . $store_bind_class_info['class_3'];
  329. $update = array();
  330. $update['goods_stateremark'] = lang('admin_delete_store_bind_class');
  331. $condition[] = array('gc_id', 'in', rtrim($gc_id, ','));
  332. $goods_model->editProducesLockUp($update, $condition);
  333. $result = $storebindclass_model->delStorebindclass(array('storebindclass_id' => $bid));
  334. if (!$result) {
  335. ds_json_encode('10001', lang('ds_common_del_fail'));
  336. } else {
  337. $this->log('删除店铺经营类目,类目编号:' . $bid . ',店铺编号:' . $store_bind_class_info['store_id']);
  338. ds_json_encode('10000', lang('ds_common_del_succ'));
  339. }
  340. }
  341. public function store_bind_class_update() {
  342. $bid = intval(input('param.id'));
  343. if ($bid <= 0) {
  344. echo json_encode(array('result' => FALSE, 'message' => lang('param_error')));
  345. die;
  346. }
  347. $new_commis_rate = intval(input('param.value'));
  348. if ($new_commis_rate < 0 || $new_commis_rate >= 100) {
  349. echo json_encode(array('result' => FALSE, 'message' => lang('param_error')));
  350. die;
  351. } else {
  352. $update = array('commis_rate' => $new_commis_rate);
  353. $condition = array('storebindclass_id' => $bid);
  354. $storebindclass_model = model('storebindclass');
  355. $result = $storebindclass_model->editStorebindclass($update, $condition);
  356. if ($result) {
  357. $this->log('更新店铺经营类目,类目编号:' . $bid);
  358. echo json_encode(array('result' => TRUE));
  359. die;
  360. } else {
  361. echo json_encode(array('result' => FALSE, 'message' => lang('ds_common_op_fail')));
  362. die;
  363. }
  364. }
  365. }
  366. /**
  367. * 店铺 待审核列表
  368. */
  369. public function store_joinin() {
  370. $condition = array();
  371. //店铺列表
  372. if (input('param.owner_and_name')) {
  373. $condition[] = array('member_name', 'like', '%' . input('param.owner_and_name') . '%');
  374. }
  375. if (input('param.store_name')) {
  376. $condition[] = array('store_name', 'like', '%' . input('param.store_name') . '%');
  377. }
  378. if (input('param.grade_id') && intval(input('param.grade_id')) > 0) {
  379. $condition[] = array('storegrade_id', '=', input('param.grade_id'));
  380. }
  381. if (input('param.joinin_state') && intval(input('param.joinin_state')) > 0) {
  382. $condition[] = array('joinin_state', '=', input('param.joinin_state'));
  383. } else {
  384. $condition[] = array('joinin_state', '>', 0);
  385. }
  386. $storejoinin_model = model('storejoinin');
  387. $store_list = $storejoinin_model->getStorejoininList($condition, 10, 'joinin_state asc');
  388. View::assign('store_list', $store_list);
  389. View::assign('joinin_state_array', $this->get_store_joinin_state());
  390. //店铺等级
  391. $storegrade_model = model('storegrade');
  392. $grade_list = $storegrade_model->getStoregradeList();
  393. View::assign('grade_list', $grade_list);
  394. View::assign('show_page', $storejoinin_model->page_info->render());
  395. View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
  396. $this->setAdminCurItem('store_joinin');
  397. return View::fetch('store_joinin');
  398. }
  399. /**
  400. * 经营类目申请列表
  401. */
  402. public function store_bind_class_applay_list() {
  403. $condition = array();
  404. // 不显示自营店铺绑定的类目
  405. $state = input('param.state');
  406. if ($state != '') {
  407. if (in_array($state, array('0', '1',))) {
  408. $condition[] = array('storebindclass_state', '=', intval($state));
  409. }
  410. } else {
  411. $condition[] = array('storebindclass_state', 'in', array('0', '1',));
  412. }
  413. $store_id = input('store_id');
  414. if (intval($store_id)) {
  415. $condition[] = array('store_id', '=', intval($store_id));
  416. }
  417. $storebindclass_model = model('storebindclass');
  418. $store_bind_class_list = $storebindclass_model->getStorebindclassList($condition, 15, 'storebindclass_state asc,storebindclass_id desc');
  419. $goods_class = model('goodsclass')->getGoodsclassIndexedListAll();
  420. $store_ids = array();
  421. for ($i = 0; $i < count($store_bind_class_list); $i++) {
  422. $store_bind_class_list[$i]['class_1_name'] = @$goods_class[$store_bind_class_list[$i]['class_1']]['gc_name'];
  423. $store_bind_class_list[$i]['class_2_name'] = @$goods_class[$store_bind_class_list[$i]['class_2']]['gc_name'];
  424. $store_bind_class_list[$i]['class_3_name'] = @$goods_class[$store_bind_class_list[$i]['class_3']]['gc_name'];
  425. $store_ids[] = $store_bind_class_list[$i]['store_id'];
  426. }
  427. //取店铺信息
  428. $store_model = model('store');
  429. $store_list = $store_model->getStoreList(array(array('store_id', 'in', $store_ids)), null);
  430. $bind_store_list = array();
  431. if (!empty($store_list) && is_array($store_list)) {
  432. foreach ($store_list as $k => $v) {
  433. $bind_store_list[$v['store_id']]['store_name'] = $v['store_name'];
  434. $bind_store_list[$v['store_id']]['seller_name'] = $v['seller_name'];
  435. }
  436. }
  437. View::assign('bind_list', $store_bind_class_list);
  438. View::assign('bind_store_list', $bind_store_list);
  439. View::assign('show_page', $storebindclass_model->page_info->render());
  440. View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
  441. $this->setAdminCurItem('store_bind_class_applay_list');
  442. return View::fetch('bind_class_applay_list');
  443. }
  444. /**
  445. * 审核经营类目申请
  446. */
  447. public function store_bind_class_applay_check() {
  448. $storebindclass_model = model('storebindclass');
  449. $condition = array();
  450. $condition[] = array('storebindclass_id', '=', intval(input('param.bid')));
  451. $condition[] = array('storebindclass_state', '=', 0);
  452. $update = $storebindclass_model->editStorebindclass(array('storebindclass_state' => 1), $condition);
  453. if ($update) {
  454. $this->log('审核新经营类目申请,店铺ID:' . input('param.store_id'), 1);
  455. ds_json_encode(10000, lang('ds_common_op_succ'));
  456. } else {
  457. $this->error(lang('ds_common_op_fail'), get_referer());
  458. }
  459. }
  460. /**
  461. * 删除经营类目申请
  462. */
  463. public function store_bind_class_applay_del() {
  464. $storebindclass_model = model('storebindclass');
  465. $condition = array();
  466. $condition[] = array('storebindclass_id', '=', intval(input('param.bid')));
  467. $del = $storebindclass_model->delStorebindclass($condition);
  468. if ($del) {
  469. $this->log('删除经营类目,店铺ID:' . input('param.store_id'), 1);
  470. ds_json_encode(10000, lang('ds_common_del_succ'));
  471. } else {
  472. $this->error(lang('ds_common_del_fail'), get_referer());
  473. }
  474. }
  475. private function get_store_joinin_state() {
  476. $joinin_state_array = array(
  477. STORE_JOIN_STATE_NEW => lang('store_join_state_new'),
  478. STORE_JOIN_STATE_PAY => lang('store_join_state_pay'),
  479. STORE_JOIN_STATE_VERIFY_SUCCESS => lang('storereopen_state_0'),
  480. STORE_JOIN_STATE_VERIFY_FAIL => lang('store_join_state_verify_fail'),
  481. STORE_JOIN_STATE_PAY_FAIL => lang('store_join_state_pay_fail'),
  482. STORE_JOIN_STATE_FINAL => lang('store_join_state_final'),
  483. );
  484. return $joinin_state_array;
  485. }
  486. /**
  487. * 店铺续签申请列表
  488. */
  489. public function reopen_list() {
  490. $condition = array();
  491. $store_id = input('get.store_id');
  492. if (intval($store_id)) {
  493. $condition[] = array('storereopen_store_id', '=', intval($store_id));
  494. }
  495. $store_name = input('get.store_name');
  496. if (!empty($store_name)) {
  497. $condition[] = array('storereopen_store_name', '=', $store_name);
  498. }
  499. $storereopen_state = input('get.storereopen_state');
  500. if ($storereopen_state != '') {
  501. $condition[] = array('storereopen_state', '=', intval($storereopen_state));
  502. }
  503. $storereopen_model = model('storereopen');
  504. $reopen_list = $storereopen_model->getStorereopenList($condition, 15);
  505. View::assign('reopen_list', $reopen_list);
  506. View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
  507. View::assign('show_page', $storereopen_model->page_info->render());
  508. $this->setAdminCurItem('reopen_list');
  509. return View::fetch('store_reopen_list');
  510. }
  511. /**
  512. * 审核店铺续签申请
  513. */
  514. public function reopen_check() {
  515. if (intval(input('param.storereopen_id')) <= 0)
  516. exit();
  517. $storereopen_model = model('storereopen');
  518. $condition = array();
  519. $condition[] = array('storereopen_id', '=', intval(input('param.storereopen_id')));
  520. $condition[] = array('storereopen_state', '=', 1);
  521. //取当前申请信息
  522. $reopen_info = $storereopen_model->getStorereopenInfo($condition);
  523. $data = array();
  524. $data['storereopen_state'] = 2;
  525. $update = $storereopen_model->editStorereopen($data, $condition);
  526. //取目前店铺有效截止日期
  527. $store_info = model('store')->getStoreInfoByID($reopen_info['storereopen_store_id']);
  528. $start_time = strtotime(date('Y-m-d 0:0:0', $store_info['store_endtime'])) + 24 * 3600;
  529. $new_store_endtime = strtotime(date('Y-m-d 23:59:59', $start_time) . " +" . intval($reopen_info['storereopen_year']) . " year");
  530. if ($update) {
  531. //更新店铺有效期
  532. model('store')->editStore(array('store_endtime' => $new_store_endtime), array('store_id' => $reopen_info['storereopen_store_id']));
  533. $msg = '审核通过店铺续签申请,店铺ID:' . $reopen_info['storereopen_store_id'];
  534. $this->log($msg, 1);
  535. ds_json_encode('10000', lang('ds_common_op_succ'));
  536. } else {
  537. ds_json_encode('10001', lang('ds_common_op_fail'));
  538. }
  539. }
  540. /**
  541. * 删除店铺续签申请
  542. */
  543. public function reopen_del() {
  544. $storereopen_model = model('storereopen');
  545. $condition = array();
  546. $condition[] = array('storereopen_id', '=', intval(input('param.storereopen_id')));
  547. $condition[] = array('storereopen_state', 'in', array(0, 1));
  548. //取当前申请信息
  549. $reopen_info = $storereopen_model->getStorereopenInfo($condition);
  550. $cert_file = BASE_UPLOAD_PATH . DIRECTORY_SEPARATOR . ATTACH_STORE_JOININ . DIRECTORY_SEPARATOR . $reopen_info['storereopen_pay_cert'];
  551. $del = $storereopen_model->delStorereopen($condition);
  552. if ($del) {
  553. if (is_file($cert_file)) {
  554. unlink($cert_file);
  555. }
  556. $this->log('删除店铺续签目申请,店铺ID:' . input('param.storereopen_store_id'), 1);
  557. ds_json_encode('10000', lang('ds_common_del_succ'));
  558. } else {
  559. ds_json_encode('10001', lang('ds_common_del_fail'));
  560. }
  561. }
  562. /**
  563. * 审核详细页
  564. */
  565. public function store_joinin_detail() {
  566. $storejoinin_model = model('storejoinin');
  567. $member_id = input('param.member_id');
  568. $joinin_detail = $storejoinin_model->getOneStorejoinin(array('member_id' => $member_id));
  569. $joinin_detail_title = lang('ds_view');
  570. if (in_array(intval($joinin_detail['joinin_state']), array(STORE_JOIN_STATE_NEW, STORE_JOIN_STATE_PAY))) {
  571. $joinin_detail_title = lang('ds_verify');
  572. }
  573. if (!empty($joinin_detail['sg_info'])) {
  574. $store_grade_info = model('storegrade')->getOneStoregrade($joinin_detail['storegrade_id']);
  575. $joinin_detail['storegrade_price'] = $store_grade_info['storegrade_price'];
  576. } else {
  577. $joinin_detail['sg_info'] = @unserialize($joinin_detail['sg_info']);
  578. if (is_array($joinin_detail['sg_info'])) {
  579. $joinin_detail['storegrade_price'] = $joinin_detail['sg_info']['storegrade_price'];
  580. }
  581. }
  582. View::assign('joinin_detail_title', $joinin_detail_title);
  583. View::assign('joinin_detail', $joinin_detail);
  584. return View::fetch('store_joinin_detail');
  585. }
  586. /**
  587. * 审核
  588. */
  589. public function store_joinin_verify() {
  590. $storejoinin_model = model('storejoinin');
  591. $joinin_detail = $storejoinin_model->getOneStorejoinin(array('member_id' => input('param.member_id')));
  592. switch (intval($joinin_detail['joinin_state'])) {
  593. case STORE_JOIN_STATE_NEW:
  594. $this->store_joinin_verify_pass($joinin_detail);
  595. break;
  596. case STORE_JOIN_STATE_PAY:
  597. $this->store_joinin_verify_open($joinin_detail);
  598. break;
  599. default:
  600. $this->error(lang('param_error'));
  601. break;
  602. }
  603. }
  604. private function store_joinin_verify_pass($joinin_detail) {
  605. $param = array();
  606. $param['joinin_state'] = input('post.verify_type') === 'pass' ? STORE_JOIN_STATE_VERIFY_SUCCESS : STORE_JOIN_STATE_VERIFY_FAIL;
  607. $param['joinin_message'] = input('post.joinin_message');
  608. $param['paying_amount'] = abs(floatval(input('post.paying_amount')));
  609. $commis_rate_array = input('post.commis_rate/a'); #获取数组
  610. $param['store_class_commis_rates'] = is_array($commis_rate_array) ? implode(',', $commis_rate_array) : '';
  611. $storejoinin_model = model('storejoinin');
  612. $storejoinin_model->editStorejoinin($param, array('member_id' => input('post.member_id')));
  613. if ($param['paying_amount'] > 0) {
  614. dsLayerOpenSuccess(lang('store_join_verify_final'));
  615. } else {
  616. //如果开店支付费用为零,则审核通过后直接开通,无需再上传付款凭证
  617. $this->store_joinin_verify_open($joinin_detail);
  618. }
  619. }
  620. private function store_joinin_verify_open($joinin_detail) {
  621. $storejoinin_model = model('storejoinin');
  622. $store_model = model('store');
  623. $seller_model = model('seller');
  624. //验证卖家用户名是否已经存在
  625. if ($seller_model->isSellerExist(array('seller_name' => $joinin_detail['seller_name']))) {
  626. $this->error(lang('seller_name_exist'));
  627. }
  628. $param = array();
  629. $param['joinin_state'] = input('post.verify_type') === 'pass' ? STORE_JOIN_STATE_FINAL : STORE_JOIN_STATE_PAY_FAIL;
  630. $param['joinin_message'] = input('post.joinin_message');
  631. if (input('post.verify_type') === 'pass') {
  632. //开店
  633. $shop_array = array();
  634. $shop_array['member_id'] = $joinin_detail['member_id'];
  635. $shop_array['member_name'] = $joinin_detail['member_name'];
  636. $shop_array['seller_name'] = $joinin_detail['seller_name'];
  637. $shop_array['grade_id'] = $joinin_detail['storegrade_id'];
  638. $shop_array['store_name'] = $joinin_detail['store_name'];
  639. $shop_array['storeclass_id'] = $joinin_detail['storeclass_id'];
  640. $shop_array['store_company_name'] = $joinin_detail['company_name'];
  641. $shop_array['region_id'] = $joinin_detail['company_province_id'];
  642. $shop_array['store_longitude'] = $joinin_detail['store_longitude'];
  643. $shop_array['store_latitude'] = $joinin_detail['store_latitude'];
  644. $shop_array['area_info'] = $joinin_detail['company_address'];
  645. $shop_array['store_address'] = $joinin_detail['company_address_detail'];
  646. $shop_array['store_zip'] = '';
  647. $shop_array['store_mainbusiness'] = '';
  648. $shop_array['store_state'] = 1;
  649. $shop_array['store_addtime'] = TIMESTAMP;
  650. $shop_array['store_endtime'] = strtotime(date('Y-m-d 23:59:59', strtotime('+1 day')) . " +" . intval($joinin_detail['joinin_year']) . " year");
  651. //$shop_array['store_avaliable_deposit']=$joinin_detail['storeclass_bail'];
  652. $store_id = $store_model->addStore($shop_array);
  653. if ($store_id) {
  654. //记录保证金
  655. if ($joinin_detail['storeclass_bail'] > 0) {
  656. $storedepositlog_model = model('storedepositlog');
  657. try {
  658. Db::startTrans();
  659. $storedepositlog_model->changeStoredeposit(array(
  660. 'store_id' => $store_id,
  661. 'storedepositlog_type' => Storedepositlog::TYPE_PAY,
  662. 'storedepositlog_state' => Storedepositlog::STATE_VALID,
  663. 'storedepositlog_add_time' => TIMESTAMP,
  664. 'store_avaliable_deposit' => $joinin_detail['storeclass_bail'],
  665. 'storedepositlog_desc' => lang('store_open_add_deposit'),
  666. ));
  667. Db::commit();
  668. } catch (\Exception $e) {
  669. Db::rollback();
  670. $this->error($e->getMessage());
  671. }
  672. }
  673. //写入卖家账号
  674. $seller_array = array();
  675. $seller_array['seller_name'] = $joinin_detail['seller_name'];
  676. $seller_array['member_id'] = $joinin_detail['member_id'];
  677. $seller_array['sellergroup_id'] = 0;
  678. $seller_array['store_id'] = $store_id;
  679. $seller_array['is_admin'] = 1;
  680. $state = $seller_model->addSeller($seller_array);
  681. //改变店铺状态
  682. $storejoinin_model->editStorejoinin($param, array('member_id' => input('param.member_id')));
  683. }
  684. if ($state) {
  685. // 添加相册默认
  686. $album_model = model('album');
  687. $album_arr = array();
  688. $album_arr['aclass_name'] = lang('store_save_defaultalbumclass_name');
  689. $album_arr['store_id'] = $store_id;
  690. $album_arr['aclass_des'] = '';
  691. $album_arr['aclass_sort'] = '255';
  692. $album_arr['aclass_cover'] = '';
  693. $album_arr['aclass_uploadtime'] = TIMESTAMP;
  694. $album_arr['aclass_isdefault'] = '1';
  695. $album_model->addAlbumclass($album_arr);
  696. //插入店铺扩展表
  697. $store_model->addStoreextend(array('store_id' => $store_id));
  698. $msg = lang('store_save_create_success');
  699. //插入店铺绑定分类表
  700. $store_bind_class_array = array();
  701. $store_bind_class = unserialize($joinin_detail['store_class_ids']);
  702. $store_bind_commis_rates = explode(',', $joinin_detail['store_class_commis_rates']);
  703. for ($i = 0, $length = count($store_bind_class); $i < $length; $i++) {
  704. @list($class1, $class2, $class3) = explode(',', $store_bind_class[$i]);
  705. $store_bind_class_array[] = array(
  706. 'store_id' => $store_id,
  707. 'commis_rate' => $store_bind_commis_rates[$i],
  708. 'class_1' => intval($class1),
  709. 'class_2' => intval($class2),
  710. 'class_3' => intval($class3),
  711. 'storebindclass_state' => 1
  712. );
  713. }
  714. $storebindclass_model = model('storebindclass');
  715. $storebindclass_model->addStorebindclassAll($store_bind_class_array);
  716. dsLayerOpenSuccess(lang('store_open_success'));
  717. } else {
  718. $this->error(lang('store_open_fail'));
  719. }
  720. } else {
  721. //改变店铺状态
  722. $storejoinin_model->editStorejoinin($param, array('member_id' => input('param.member_id')));
  723. dsLayerOpenSuccess(lang('ds_common_op_succ'));
  724. // $this->error(lang('store_open_reject'));
  725. }
  726. }
  727. /**
  728. * 提醒续费
  729. */
  730. public function remind_renewal() {
  731. $store_id = intval(input('param.store_id'));
  732. $store_info = model('store')->getStoreInfoByID($store_id);
  733. if (!empty($store_info) && $store_info['store_endtime'] < (TIMESTAMP + 864000) && cookie('remindRenewal' . $store_id) == null) {
  734. // 发送商家消息
  735. $param = array();
  736. $param['code'] = 'store_expire';
  737. $param['store_id'] = intval(input('param.store_id'));
  738. $param['param'] = array();
  739. $param['ali_param'] = array();
  740. $param['ten_param'] = array();
  741. //微信模板消息
  742. $param['weixin_param'] = array(
  743. // 'url' => config('ds_config.h5_site_url').'/seller/complaint_form?complain_id='.$complain_id,
  744. 'data' => array(
  745. "keyword1" => array(
  746. "value" => $store_info['store_name'],
  747. "color" => "#333"
  748. ),
  749. "keyword2" => array(
  750. "value" => date('Y-m-d', $store_info['store_endtime']),
  751. "color" => "#333"
  752. )
  753. ),
  754. );
  755. \mall\queue\QueueClient::push('sendStoremsg', $param);
  756. cookie('remindRenewal' . $store_id, 1, 86400 * 10); // 十天
  757. $this->success(lang('ds_common_op_succ'));
  758. }
  759. $this->error(lang('ds_common_op_fail'));
  760. }
  761. /*
  762. //删除店铺操作,暂时屏蔽
  763. public function del() {
  764. $store_id = intval(input('param.id'));
  765. $store_model = model('store');
  766. $storeArray = $store_model->field('is_platform_store,store_name')->find($store_id);
  767. if (empty($storeArray)) {
  768. ds_json_encode('10001', lang('外驻店铺不存在'));
  769. }
  770. if ($storeArray['is_platform_store']) {
  771. ds_json_encode('10001', lang('不能在此删除自营店铺'));
  772. }
  773. $condition = array(
  774. 'store_id' => $store_id,
  775. );
  776. if (model('goods')->getGoodsCount($condition) > 0){
  777. ds_json_encode('10001', lang('已经发布商品的外驻店铺不能被删除'));
  778. }
  779. // 完全删除店铺
  780. $store_model->delStoreEntirely($condition);
  781. //删除入驻相关
  782. $member_id = intval(input('param.member_id'));
  783. $store_joinin = model('storejoinin');
  784. $condition = array(
  785. 'member_id' => $member_id,
  786. );
  787. $store_joinin->delStorejoinin($condition);
  788. $this->log("删除外驻店铺: {$storeArray['store_name']}");
  789. ds_json_encode('10000', lang('ds_common_del_succ'));
  790. }
  791. *
  792. */
  793. //删除店铺操作
  794. public function del_join() {
  795. $member_id = (int) input('param.member_id');
  796. $store_joinin = model('storejoinin');
  797. $condition = array(
  798. 'member_id' => $member_id,
  799. );
  800. $mm = $store_joinin->getOneStorejoinin($condition);
  801. if (empty($mm)) {
  802. $this->error(lang('ds_common_op_fail'), get_referer());
  803. }
  804. if ($mm['joinin_state'] == '20') {
  805. }
  806. $store_name = $mm['store_name'];
  807. $store_model = model('store');
  808. $scount = $store_model->getStoreCount($condition);
  809. if ($scount > 0) {
  810. $this->error(lang('store_exist'), get_referer());
  811. }
  812. // 完全删除店铺入驻
  813. $store_joinin->delStorejoinin($condition);
  814. $this->log(lang('del_store') . ":" . $store_name);
  815. ds_json_encode('10000', lang('ds_common_del_succ'));
  816. }
  817. public function newshop_add() {
  818. if (!request()->isPost()) {
  819. return View::fetch('store_newshop_add');
  820. } else {
  821. $member_name = input('post.member_name');
  822. $member_password = input('post.member_password');
  823. $seller_name = input('post.seller_name');
  824. $store_name = input('post.store_name');
  825. if (strlen($member_name) < 3 || strlen($member_name) > 15 || strlen($seller_name) < 3 || strlen($seller_name) > 15)
  826. $this->error(lang('name_length_error'));
  827. if (strlen($member_password) < 6)
  828. $this->error(lang('member_password_minlength'));
  829. if (!$this->checkMemberName($member_name))
  830. $this->error(lang('member_name_exist'));
  831. if (!$this->checkSellerName($seller_name))
  832. $this->error(lang('seller_name_remote'));
  833. try {
  834. $memberId = model('member')->addMember(array(
  835. 'member_name' => $member_name,
  836. 'member_password' => $member_password,
  837. ));
  838. } catch (Exception $ex) {
  839. $this->error(lang('seller_account_add_fail'));
  840. }
  841. $store_model = model('store');
  842. $saveArray = array();
  843. $saveArray['store_name'] = $store_name;
  844. $saveArray['member_id'] = $memberId;
  845. $saveArray['member_name'] = $member_name;
  846. $saveArray['seller_name'] = $seller_name;
  847. $saveArray['bind_all_gc'] = 1;
  848. $saveArray['store_state'] = 1;
  849. $saveArray['store_addtime'] = TIMESTAMP;
  850. $saveArray['is_platform_store'] = 0;
  851. $saveArray['grade_id'] = 1;
  852. $storeId = $store_model->addStore($saveArray);
  853. model('seller')->addSeller(array(
  854. 'seller_name' => $seller_name,
  855. 'member_id' => $memberId,
  856. 'store_id' => $storeId,
  857. 'sellergroup_id' => 0,
  858. 'is_admin' => 1,
  859. ));
  860. model('storejoinin')->addStorejoinin(array(
  861. 'seller_name' => $seller_name,
  862. 'store_name' => $store_name,
  863. 'member_name' => $member_name,
  864. 'member_id' => $memberId,
  865. 'joinin_state' => 40,
  866. 'company_province_id' => 0,
  867. 'storeclass_bail' => 0,
  868. 'joinin_year' => 1,
  869. ));
  870. // 添加相册默认
  871. $album_model = model('album');
  872. $album_arr = array();
  873. $album_arr['aclass_name'] = lang('store_save_defaultalbumclass_name');
  874. $album_arr['store_id'] = $storeId;
  875. $album_arr['aclass_des'] = '';
  876. $album_arr['aclass_sort'] = '255';
  877. $album_arr['aclass_cover'] = '';
  878. $album_arr['aclass_uploadtime'] = TIMESTAMP;
  879. $album_arr['aclass_isdefault'] = '1';
  880. $album_model->addAlbumclass($album_arr);
  881. //插入店铺扩展表
  882. $store_model->addStoreextend(array('store_id' => $storeId));
  883. // 删除自营店id缓存
  884. model('store')->dropCachedOwnShopIds();
  885. $this->log(lang('add_store') . ": {$saveArray['store_name']}");
  886. $this->success(lang('add_store_bind_class'), (string) url('Store/store_bind_class', ['store_id' => $storeId]));
  887. }
  888. }
  889. public function check_seller_name() {
  890. echo json_encode($this->checkSellerName(input('param.seller_name')));
  891. exit;
  892. }
  893. private function checkSellerName($sellerName) {
  894. // 判断store_joinin是否存在记录
  895. $count = (int) model('storejoinin')->getStorejoininCount(array(
  896. 'seller_name' => $sellerName,
  897. ));
  898. if ($count > 0)
  899. return false;
  900. $seller = model('seller')->getSellerInfo(array(
  901. 'seller_name' => $sellerName,
  902. ));
  903. if (!empty($seller)) {
  904. return false;
  905. }
  906. return TRUE;
  907. }
  908. public function check_member_name() {
  909. echo json_encode($this->checkMemberName(input('param.member_name')));
  910. exit;
  911. }
  912. private function checkMemberName($member_name) {
  913. // 判断store_joinin是否存在记录
  914. $count = (int) model('storejoinin')->getStorejoininCount(array(
  915. 'member_name' => $member_name,
  916. ));
  917. if ($count > 0)
  918. return false;
  919. return !model('member')->getMemberCount(array(
  920. 'member_name' => $member_name,
  921. ));
  922. }
  923. /**
  924. * 验证店铺名称是否存在
  925. */
  926. public function ckeck_store_name() {
  927. $where = array();
  928. $where[] = array('store_name', '=', input('param.store_name'));
  929. $where[] = array('store_id', '<>', input('param.store_id'));
  930. $store_info = model('store')->getStoreInfo($where);
  931. if (!empty($store_info['store_name'])) {
  932. echo 'false';
  933. } else {
  934. echo 'true';
  935. }
  936. }
  937. /**
  938. * 验证店铺名称是否存在
  939. */
  940. private function ckeckStoreName($store_name) {
  941. $condition = array();
  942. $condition[] = array('store_name', '=', $store_name);
  943. $store_info = model('store')->getStoreInfo($condition);
  944. if (!empty($store_info['store_name'])) {
  945. return false;
  946. } else {
  947. return true;
  948. }
  949. }
  950. //ajax操作
  951. public function ajax() {
  952. $store_model = model('store');
  953. switch (input('param.branch')) {
  954. /**
  955. * 品牌名称
  956. */
  957. case 'store_sort':
  958. $id = intval(input('param.id'));
  959. $result = $store_model->editStore(array('store_sort' => trim(input('param.value'))), array('store_id' => $id));
  960. if ($result) {
  961. $this->log(lang('ds_edit') . lang('ds_store') . '[' . $id . ']', 1);
  962. }
  963. echo 'true';
  964. exit;
  965. break;
  966. }
  967. }
  968. /**
  969. * 获取卖家栏目列表,针对控制器下的栏目
  970. */
  971. protected function getAdminItemList() {
  972. $menu_array = array(
  973. array(
  974. 'name' => 'store',
  975. 'text' => lang('ds_manage'),
  976. 'url' => (string) url('Store/store')
  977. ), array(
  978. 'name' => 'store_joinin',
  979. 'text' => lang('pending'),
  980. 'url' => (string) url('Store/store_joinin')
  981. ), array(
  982. 'name' => 'reopen_list',
  983. 'text' => lang('reopen_list'),
  984. 'url' => (string) url('Store/reopen_list')
  985. ), array(
  986. 'name' => 'store_bind_class_applay_list',
  987. 'text' => lang('store_bind_class_apply'),
  988. 'url' => (string) url('Store/store_bind_class_applay_list')
  989. ), array(
  990. 'name' => 'newshop_add',
  991. 'text' => lang('add_store'),
  992. 'url' => "javascript:dsLayerOpen('" . (string) url('Store/newshop_add') . "','" . lang('add_store') . "')"
  993. )
  994. );
  995. if (request()->action() == 'store_bind_class') {
  996. $menu_array[] = [
  997. 'name' => 'store_bind_class', 'text' => lang('ds_edit') . lang('store_bind_class'), 'url' => '#'
  998. ];
  999. }
  1000. return $menu_array;
  1001. }
  1002. }
  1003. ?>