Memberflea.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  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. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  11. * 网站地址: https://www.valimart.net/
  12. * ----------------------------------------------------------------------------
  13. *
  14. * ============================================================================
  15. * 控制器
  16. */
  17. class Memberflea extends BaseFleaMember {
  18. public function initialize() {
  19. parent::initialize(); // TODO: Change the autogenerated stub
  20. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/fleacommon.lang.php');
  21. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/memberflea.lang.php');
  22. }
  23. /**
  24. * 默认显示闲置列表
  25. */
  26. public function index() {
  27. /**
  28. * 实例化闲置物品模型
  29. */
  30. $flea_model = model('flea');
  31. $special_condition['member_id'] = session('member_id');
  32. $special_condition['keyword'] = addslashes(trim(input('keyword')));
  33. $special_condition['order'] = 'goods_id desc';
  34. $list_goods = $flea_model->getFleaList($special_condition, 10, '*', 'goods_id desc', 14);
  35. if (is_array($list_goods) and ! empty($list_goods)) {
  36. foreach ($list_goods as $key => $val) {
  37. $list_goods[$key]['goods_image'] = $list_goods[$key]['goods_image'] == '' ? '' : ds_get_pic( ATTACH_MFLEA . '/' . session('member_id') , str_replace('_1024', '_240', $val['goods_image']));
  38. }
  39. }
  40. View::assign('show_page', $flea_model->page_info->render());
  41. View::assign('list_goods', $list_goods);
  42. //查询会员信息
  43. $this->member_info = $this->getMemberAndGradeInfo(true);
  44. View::assign('menu_sign', 'flea');
  45. View::assign('menu_sign_url', (string) url('Memberflea/index'));
  46. View::assign('menu_sign1', 'flea_list');
  47. $this->setMemberCurItem('index');
  48. $this->setMemberCurMenu('member_flea');
  49. return View::fetch($this->template_dir . 'store_flea_list');
  50. }
  51. /**
  52. * 添加闲置
  53. */
  54. public function add_goods() {
  55. /**
  56. * 检测用户发布闲置物品个数
  57. */
  58. $flea_model = model('flea');
  59. $goods_num = $flea_model->getFleaCount(array('member_id' => session('member_id')));
  60. if ($goods_num >= 10) {
  61. $this->error(lang('store_goods_index_flea_notice1'));
  62. }
  63. /**
  64. * 实例化商品分类模型
  65. */
  66. $fleaclass_model = model('fleaclass');
  67. $goods_class = $fleaclass_model->getTreeClassList(1);
  68. View::assign('goods_class', $goods_class);
  69. /**
  70. * 地区
  71. */
  72. $this->fleaarea_show();
  73. $goods_image_path = ATTACH_MFLEA . '/' . session('member_id') ; //店铺商品图片目录地址
  74. View::assign('goods_image_path', $goods_image_path);
  75. View::assign('item_id', '');
  76. //查询会员信息
  77. $this->member_info = $this->getMemberAndGradeInfo(true);
  78. $this->setMemberCurItem('goods_add');
  79. $this->setMemberCurMenu('member_flea');
  80. View::assign('menu_sign', 'flea');
  81. View::assign('menu_sign_url', (string) url('Memberflea/index'));
  82. View::assign('menu_sign1', 'add_flea_goods');
  83. echo View::fetch($this->template_dir . 'store_flea_goods_add');
  84. }
  85. /**
  86. * 保存闲置物品
  87. */
  88. public function save_goods() {
  89. /**
  90. * 清除前一天冗余图片数据
  91. */
  92. $fleaupload_model = model('fleaupload');
  93. $upload_array = array();
  94. $upload_array[] = array('store_id', '=', session('member_id'));
  95. $upload_array[] = array('fleaupload_type', '=', '12');
  96. $upload_array[] = array('item_id', '=', '0');
  97. $upload_array[] = array('fleaupload_time', '<', TIMESTAMP - 24 * 60 * 60);
  98. $fleaupload_model->delFleaupload($upload_array, session('member_id'));
  99. unset($upload_array);
  100. if (request()->isPost()) {
  101. /**
  102. * 验证表单
  103. */
  104. $data = [
  105. 'goods_name' => input('post.goods_name'),
  106. 'goods_price' => input('post.goods_price')
  107. ];
  108. $memberflea_validate = ds_validate('memberflea');
  109. if (!$memberflea_validate->scene('save_goods')->check($data)) {
  110. ds_json_encode(10001, $memberflea_validate->getError());
  111. }
  112. /**
  113. * 实例化店铺商品模型
  114. */
  115. $flea_model = model('flea');
  116. $goods_array = array();
  117. $goods_array['member_id'] = session('member_id');
  118. $goods_array['member_name'] = session('member_name');
  119. $goods_array['goods_name'] = input('post.goods_name');
  120. $goods_array['fleaclass_id'] = input('post.cate_id');
  121. $goods_array['fleaclass_name'] = input('post.cate_name');
  122. $goods_array['flea_quality'] = input('post.sh_quality');
  123. $goods_array['flea_pname'] = input('post.flea_pname');
  124. $goods_array['fleaarea_id'] = input('post.area_id');
  125. $goods_array['fleaarea_name'] = input('post.area_info');
  126. $goods_array['flea_pphone'] = input('post.flea_pphone');
  127. $goods_array['goods_tag'] = input('post.goods_tag');
  128. $goods_array['goods_price'] = input('post.goods_price');
  129. $goods_array['goods_store_price'] = input('post.goods_store_price');
  130. $goods_array['goods_show'] = '1';
  131. $goods_array['goods_body'] = input('post.mct_introduce');
  132. $goods_array['goods_keywords'] = input('post.seo_keywords');
  133. $goods_array['goods_description'] = input('post.seo_description');
  134. $res=word_filter($goods_array['goods_name'].' '.$goods_array['goods_tag'].' '.$goods_array['goods_body'].' '.$goods_array['flea_pname'].' '.$goods_array['goods_keywords'].' '.$goods_array['goods_description']);
  135. if(!$res['code']){
  136. ds_json_encode(10001,$res['msg']);
  137. }
  138. if($res['data']['if_sensitive']){
  139. ds_json_encode(10001,implode('、',$res['data']['sensitive_msg']));
  140. }
  141. $state = $flea_model->addFlea($goods_array);
  142. if ($state) {
  143. /**
  144. * 更新闲置物品多图
  145. */
  146. $upload_array = array();
  147. $upload_array[] = array('store_id', '=', session('member_id'));
  148. $upload_array[] = array('item_id', '=', '0');
  149. $upload_array[] = array('fleaupload_type', 'in', array('12', '13'));
  150. $goods_file_id_array = input('post.goods_file_id/a');
  151. $upload_array[] = array('fleaupload_id', 'in', implode(",", $goods_file_id_array));
  152. $fleaupload_model->editFleaupload(array('item_id' => $state), $upload_array);
  153. /**
  154. * 商品封面图片修改
  155. */
  156. if (!empty($goods_file_id_array[0])) {
  157. $image_info = $flea_model->getFleauploadList(array('fleaupload_id' => intval($goods_file_id_array[0])));
  158. $goods_image = $image_info[0]['fleafile_name'];
  159. $flea_model->editFlea(array('goods_image' => $goods_image), array('goods_id' => $state, 'member_id' => $this->member_info['member_id']));
  160. }
  161. ds_json_encode(10000, lang('store_goods_index_flea_add_success'));
  162. } else {
  163. ds_json_encode(10001, lang('store_goods_index_flea_add_fail'));
  164. }
  165. }
  166. }
  167. /**
  168. * 删除闲置物品
  169. */
  170. public function flea_del() {
  171. /**
  172. * 实例化闲置物品模型
  173. */
  174. $flea_model = model('flea');
  175. /**
  176. * 检查商品是否属于店铺
  177. */
  178. $goods_id = trim(input('goods_id'));
  179. if (empty($goods_id)) {
  180. ds_json_encode(10001, lang('param_error'));
  181. }
  182. //统计输入数量
  183. $goods_id_array = explode(',', $goods_id);
  184. $input_goods_count = count($goods_id_array);
  185. //统计确认的数量
  186. $condition = array();
  187. $condition[] = array('member_id', '=', session('member_id'));
  188. $condition[] = array('goods_id', 'in', $goods_id);
  189. $verify_count = $flea_model->getFleaCount($condition);
  190. //判断输入和确认是否一致
  191. if ($input_goods_count !== $verify_count) {
  192. ds_json_encode(10001, lang('param_error'));
  193. }
  194. $state = $flea_model->delFlea($goods_id);
  195. if ($state) {
  196. ds_json_encode(10000, lang('store_goods_index_flea_del_success'));
  197. } else {
  198. ds_json_encode(10001, lang('store_goods_index_flea_del_fail'));
  199. }
  200. }
  201. public function drop_image() {
  202. $id = intval(input('id'));
  203. $fleaupload_model = model('fleaupload');
  204. $drop_stata = $fleaupload_model->delFleaupload(array('fleaupload_id' => $id, 'store_id' => session('member_id')), session('member_id'));
  205. if ($drop_stata) {
  206. echo json_encode(array('done' => true));
  207. exit;
  208. }
  209. }
  210. /**
  211. * 编辑闲置物品页面
  212. */
  213. public function edit_goods() {
  214. /**
  215. * 实例化店铺商品模型
  216. */
  217. $flea_model = model('flea');
  218. $goods_array = $flea_model->getFleaList(array('goods_id' => intval(input('param.goods_id'))));
  219. View::assign('goods', $goods_array[0]);
  220. View::assign('goods_id', $goods_array[0]['goods_id']);
  221. $goods_image_path = ATTACH_MFLEA . '/' . session('member_id'); //店铺商品图片目录地址
  222. $goods_image = $flea_model->getFleauploadList(array('store_id' => session('member_id'), 'item_id' => $goods_array[0]['goods_id'], 'fleaupload_type' => 12));
  223. if (is_array($goods_image) and ! empty($goods_image)) {
  224. $goods_image_1 = ds_get_pic($goods_image_path , $goods_array[0]['goods_image']); //封面图
  225. $image_key = 0;
  226. foreach ($goods_image as $key => $val) {
  227. $goods_image[$key] = $val;
  228. if ($goods_array[0]['goods_image'] == $val['fleafile_name'])
  229. $image_key = $key;
  230. }
  231. if ($image_key > 0) {//将封面图放到第一位显示
  232. $goods_image_0 = $goods_image[0];
  233. $goods_image[0] = $goods_image[$image_key];
  234. $goods_image[$image_key] = $goods_image_0;
  235. }
  236. }
  237. View::assign('goods_image', $goods_image);
  238. View::assign('goods_image_path', $goods_image_path);
  239. /**
  240. * 实例化商品分类模型
  241. */
  242. $fleaclass_model = model('fleaclass');
  243. $goods_class = $fleaclass_model->getTreeClassList(1);
  244. View::assign('goods_class', $goods_class);
  245. View::assign('item_id', $goods_array[0]['goods_id']);
  246. //查询会员信息
  247. $this->member_info = $this->getMemberAndGradeInfo(true);
  248. $this->setMemberCurItem('goods_edit');
  249. $this->setMemberCurMenu('member_flea');
  250. View::assign('menu_sign', 'flea');
  251. View::assign('menu_sign_url', (string) url('Memberflea/index'));
  252. View::assign('menu_sign1', 'edit_flea');
  253. /**
  254. * 地区
  255. */
  256. $this->fleaarea_show();
  257. return View::fetch($this->template_dir . 'store_flea_goods_add');
  258. }
  259. /**
  260. * 编辑闲置物品保存
  261. */
  262. public function edit_save_goods() {
  263. $goods_id = intval(input('post.goods_id'));
  264. if ($goods_id != 0) {
  265. /**
  266. * 验证表单
  267. */
  268. $data = [
  269. 'goods_name' => input('post.goods_name'),
  270. 'goods_price' => input('post.goods_price')
  271. ];
  272. $memberflea_validate = ds_validate('memberflea');
  273. if (!$memberflea_validate->scene('edit_save_goods')->check($data)) {
  274. ds_json_encode(10001, $memberflea_validate->getError());
  275. }
  276. /**
  277. * 实例化闲置物品模型
  278. */
  279. $flea_model = model('flea');
  280. $goods_array = array();
  281. $goods_array['goods_name'] = input('post.goods_name');
  282. $goods_array['fleaclass_id'] = input('post.cate_id');
  283. $goods_array['fleaclass_name'] = input('post.cate_name');
  284. $goods_array['flea_quality'] = input('post.sh_quality');
  285. $goods_array['flea_pname'] = input('post.flea_pname');
  286. $goods_array['fleaarea_id'] = input('post.area_id');
  287. $goods_array['fleaarea_name'] = input('post.area_info');
  288. $goods_array['flea_pphone'] = input('post.flea_pphone');
  289. $goods_array['goods_tag'] = input('post.goods_tag');
  290. $goods_array['goods_price'] = input('post.goods_price');
  291. $goods_array['goods_store_price'] = input('post.goods_store_price');
  292. $goods_array['goods_show'] = '1';
  293. $goods_array['goods_body'] = input('post.mct_introduce');
  294. $goods_array['goods_keywords'] = input('post.seo_keywords');
  295. $goods_array['goods_description'] = input('post.seo_description');
  296. $state = $flea_model->editFlea($goods_array, array('goods_id' => $goods_id, 'member_id' => $this->member_info['member_id']));
  297. if ($state >= 0) {
  298. /**
  299. * 闲置物品封面图片修改
  300. */
  301. if (!empty($_POST['goods_file_id'][0])) {
  302. $image_info = $flea_model->getFleauploadList(array('fleaupload_id' => intval($_POST['goods_file_id'][0])));
  303. $goods_image = $image_info[0]['fleafile_name'];
  304. $flea_model->editFlea(array('goods_image' => $goods_image), array('goods_id' => $goods_id, 'member_id' => $this->member_info['member_id']));
  305. }
  306. ds_json_encode(10000, lang('store_goods_index_flea_goods_edit_success'));
  307. } else {
  308. ds_json_encode(10001, lang('store_goods_index_flea_goods_edit_fail'));
  309. }
  310. }
  311. }
  312. /**
  313. * 上传图片
  314. */
  315. public function image_upload() {
  316. if (input('upload_type') == 'uploadedfile') {
  317. $fleaupload_model = model('fleaupload');
  318. $file_id = intval(input('post.file_id'));
  319. if ($file_id > 0) {
  320. $drop_stata = $fleaupload_model->delFleaupload(array('fleaupload_id' => $file_id, 'store_id' => session('member_id')), session('member_id'));
  321. }
  322. /**
  323. * 实例化json模型
  324. */
  325. /**
  326. * 上传图片
  327. */
  328. $upload_path = BASE_UPLOAD_PATH . DIRECTORY_SEPARATOR . ATTACH_MFLEA . DIRECTORY_SEPARATOR . session('member_id') . DIRECTORY_SEPARATOR;
  329. $file_name = session('member_id') . '_' . date('YmdHis') . rand(10000, 99999) . '.png';
  330. $res = ds_upload_pic(ATTACH_MFLEA . DIRECTORY_SEPARATOR . session('member_id'), 'file', $file_name);
  331. if ($res['code']) {
  332. $file_name = $res['data']['file_name'];
  333. //生成缩略图
  334. ds_create_thumb($upload_path, $file_name, '240,1024', '240,1024', '_small,_normal');
  335. } else {
  336. echo "<script type='text/javascript'>alert('" . $e->getMessage() . "');history.back();</script>";
  337. exit;
  338. }
  339. /**
  340. * 取得图像大小
  341. */
  342. list($width, $height, $type, $attr) = getimagesize(ds_get_pic(ATTACH_MFLEA . DIRECTORY_SEPARATOR . session('member_id'), $file_name));
  343. /**
  344. * 图片数据入库
  345. */
  346. $insert_array = array();
  347. $image_type = array('goods_image' => 12, 'desc_image' => 13); //debug
  348. $insert_array['fleafile_name'] = $file_name;
  349. $insert_array['fleafile_size'] = intval($_FILES['file']['size']);
  350. $insert_array['fleaupload_time'] = TIMESTAMP;
  351. $insert_array['item_id'] = intval(input('post.item_id'));
  352. $insert_array['store_id'] = session('member_id');
  353. $insert_array['fleaupload_type'] = $image_type['goods_image'];
  354. $result2 = $fleaupload_model->addFleaupload($insert_array);
  355. $data = array();
  356. $data['file_id'] = $result2;
  357. $data['file_name'] = $file_name;
  358. $data['file_path'] = $file_name;
  359. $data['file_url'] = ds_get_pic(ATTACH_MFLEA . '/' . session('member_id'),$file_name);
  360. $data['instance'] = 'goods_image';
  361. $data['id'] = intval(input('post.id'));
  362. /**
  363. * 整理为json格式
  364. */
  365. $output = json_encode($data);
  366. echo "<script type='text/javascript'>window.parent.add_uploadedfile('" . $output . "');</script>";
  367. }
  368. return View::fetch($this->template_dir . 'flea_upload_image');
  369. }
  370. /**
  371. * 判断当前分类是否为最后一级分类
  372. */
  373. public function check_class() {
  374. if (input('required') == 'false' and input('cate_id') == '0') {
  375. echo 'true';
  376. exit;
  377. }
  378. /**
  379. * 实例化商品分类模型
  380. */
  381. $fleaclass_model = model('fleaclass');
  382. $sub_class = $fleaclass_model->getFleaclassList(array('fleaclass_parent_id' => intval(input('get.cate_id'))));
  383. if (is_array($sub_class) and ! empty($sub_class)) {
  384. echo 'false';
  385. } else {
  386. echo 'true';
  387. }
  388. }
  389. /**
  390. * 买家闲置收藏
  391. *
  392. * @param
  393. * @return
  394. */
  395. public function favorites() {
  396. /**
  397. * 实例化模型
  398. */
  399. $fleafavorites_model = model('fleafavorites');
  400. /**
  401. * 类型
  402. */
  403. /**
  404. * 删除操作
  405. */
  406. if (input('drop') && input('drop') == 'ok' && input('fav_id')) {
  407. $fav_arr = explode(',', input('fav_id'));
  408. if (!empty($fav_arr) && is_array($fav_arr)) {
  409. /**
  410. * 批量删除
  411. */
  412. foreach ($fav_arr as $fav_id) {
  413. if (intval($fav_id) > 0) {
  414. $condition = array();
  415. $condition[] = array('fleafav_id', '=', intval($fav_id));
  416. $condition[] = array('member_id', '=', session('member_id'));
  417. $condition[] = array('fleafav_type', '=', 'flea');
  418. if (!$fleafavorites_model->delFleafavorites($condition)) {
  419. ds_json_encode(10001, lang('flea_favorite_del_fail'));
  420. }
  421. }
  422. }
  423. Db::name('flea')->where('goods_id', 'in', $fav_arr)->dec('flea_collect_num')->update();
  424. } else {
  425. if (intval(input('get.fav_id')) > 0) {
  426. $condition = array();
  427. $condition[] = array('fleafav_id', '=', intval(input('get.fav_id')));
  428. $condition[] = array('member_id', '=', session('member_id'));
  429. $condition[] = array('fleafav_type', '=', 'flea');
  430. if (!$fleafavorites_model->delFleafavorites($condition)) {
  431. ds_json_encode(10001, lang('flea_favorite_del_fail'));
  432. }
  433. Db::name('flea')->where('goods_id', input('fav_id'))->dec('flea_collect_num')->update();
  434. }
  435. }
  436. ds_json_encode(10000, lang('flea_favorite_del_success'));
  437. }
  438. /**
  439. * 分页
  440. */
  441. /**
  442. * 得到收藏列表
  443. */
  444. $subQuery = Db::name('fleafavorites')->field('fleafav_id')->where(array('member_id' => session('member_id'), 'fleafav_type' => 'flea'))->buildSql();
  445. $show_page = Db::name('flea')->field('goods_id,goods_name,goods_image,goods_store_price,member_name,member_id')->where('goods_id in ' . $subQuery)->paginate(['list_rows' => 10, 'query' => request()->param()], false);
  446. $type_list = $show_page->items();
  447. if (!empty($type_list) && is_array($type_list)) {
  448. foreach ($type_list as $key => $fav) {
  449. if ($fav['goods_image']) {
  450. $type_list[$key]['goods_image'] = ds_get_pic( ATTACH_MFLEA . '/' . $fav['member_id'] , str_replace('_1024', '_240', $fav['goods_image']));
  451. }
  452. }
  453. }
  454. //查询会员信息
  455. $this->member_info = $this->getMemberAndGradeInfo(true);
  456. /**
  457. * 页面输出
  458. */
  459. $this->setMemberCurItem('fav_flea');
  460. $this->setMemberCurMenu('member_flea');
  461. View::assign('menu_sign', 'flea_favorites');
  462. View::assign('favorites_list', $type_list);
  463. View::assign('show_page', $show_page);
  464. View::assign('menu_sign_url', (string) url('Memberflea/favorites'));
  465. View::assign('menu_sign1', 'flea_favorites_list');
  466. return View::fetch($this->template_dir . "favorites_flea_index");
  467. }
  468. /**
  469. * 增加买家收藏
  470. *
  471. * @param
  472. * @return
  473. */
  474. public function addfavorites() {
  475. if (intval(input('fav_id')) > 0) {
  476. /**
  477. * 实例化模型
  478. */
  479. $fleafavorites_model = model('fleafavorites');
  480. //判断商品,店铺是否为当前会员
  481. $flea_model = model('flea');
  482. $flea_info = $flea_model->getFleaList(array('goods_id' => intval(input('param.fav_id'))));
  483. if ($flea_info[0]['member_id'] == session('member_id')) {
  484. echo json_encode(array('done' => false, 'msg' => lang('flea_favorite_no_my_product')));
  485. die;
  486. }
  487. //闲置物品收藏次数增加1
  488. $check_rss = $fleafavorites_model->checkFleafavorites(intval(input('fav_id')), 'flea', session('member_id'));
  489. if (!$check_rss) {
  490. Db::name('flea')->where('goods_id', input('fav_id'))->inc('flea_collect_num')->update();
  491. $add_rs = $fleafavorites_model->addFleafavorites(array(
  492. 'member_id' => session('member_id'),
  493. 'fleafav_id' => intval(input('fav_id')),
  494. 'fleafav_type' => 'flea',
  495. 'fleafav_time' => TIMESTAMP
  496. ));
  497. if (!$add_rs) {
  498. echo json_encode(array('done' => false, 'msg' => lang('flea_favorite_collect_fail')));
  499. }
  500. echo json_encode(array('done' => true, 'msg' => lang('flea_favorite_collect_success')));
  501. }
  502. echo json_encode(array('done' => true, 'msg' => lang('flea_favorite_collect_tips')));
  503. } else {
  504. echo json_encode(array('done' => false, 'msg' => lang('flea_favorite_collect_fail')));
  505. }
  506. }
  507. private function fleaarea_show() {
  508. /**
  509. * 加载模型
  510. */
  511. $fleaarea_model = model('fleaarea');
  512. $condition[] = array('fleaarea_parent_id', '=', 0);
  513. $area_one_level = $fleaarea_model->getFleaareaList($condition, 'fleaarea_id,fleaarea_name');
  514. View::assign('area_one_level', $area_one_level);
  515. }
  516. protected function getMemberItemList() {
  517. $menu_array = array();
  518. switch (request()->action()) {
  519. case 'index':
  520. $menu_array = array(
  521. array('name' => 'index', 'text' => lang('idle_list'), 'url' => (string) url('Memberflea/index'))
  522. );
  523. break;
  524. case 'add_goods':
  525. $menu_array = array(
  526. array('name' => 'index', 'text' => lang('idle_list'), 'url' => (string) url('Memberflea/index')),
  527. array('name' => 'goods_add', 'text' => lang('release_idle'), 'url' => (string) url('Memberflea/add_goods'))
  528. );
  529. break;
  530. case 'favorites':
  531. $menu_array = array(
  532. array(
  533. 'name' => 'fav_goods', 'text' => lang('ds_member_path_collect_list'),
  534. 'url' => (string) url('Memberfavorites/fglist')
  535. ), array(
  536. 'name' => 'fav_store', 'text' => lang('ds_member_path_collect_store'),
  537. 'url' => (string) url('Memberfavorites/fslist')
  538. ),
  539. array(
  540. 'name' => 'fav_flea', 'text' => lang('collection_idle'), 'url' => (string) url('Memberflea/favorites')
  541. )
  542. );
  543. }
  544. return $menu_array;
  545. }
  546. }