MemberArrivalnotice.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. *
  7. *
  8. * ----------------------------------------------------------------------------
  9. *
  10. * 控制器
  11. */
  12. class MemberArrivalnotice extends BaseMember
  13. {
  14. public function initialize()
  15. {
  16. parent::initialize(); // TODO: Change the autogenerated stub
  17. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/member_arrivalnotice.lang.php');
  18. }
  19. /**
  20. * 到货列表
  21. *
  22. * @param
  23. * @return
  24. */
  25. public function index()
  26. {
  27. $arrivalnotice_model = model('arrivalnotice');
  28. $arrivalnotice_list = $arrivalnotice_model->getArrivalNoticeList(array('member_id' => $this->member_info['member_id']), '', '', '', 20);
  29. View::assign('arrivalnotice_list', $arrivalnotice_list);
  30. View::assign('show_page', $arrivalnotice_model->page_info->render());
  31. $this->setMemberCurItem('index');
  32. $this->setMemberCurMenu('member_arrivalnotice');
  33. return View::fetch($this->template_dir . 'index');
  34. }
  35. public function del()
  36. {
  37. $arrivalnotice_id = input('param.arrivalnotice_id');
  38. $arrivalnotice_id_array = ds_delete_param($arrivalnotice_id);
  39. if ($arrivalnotice_id_array == FALSE) {
  40. ds_json_encode('10001', lang('param_error'));
  41. }
  42. $condition = array();
  43. $condition[] = array('member_id', '=', $this->member_info['member_id']);
  44. $condition[] = array('arrivalnotice_id', 'in', $arrivalnotice_id_array);
  45. $arrivalnotice_model = model('arrivalnotice');
  46. //批量删除
  47. $result = $arrivalnotice_model->delArrivalNotice($condition);
  48. if ($result) {
  49. ds_json_encode(10000, lang('ds_common_del_succ'));
  50. } else {
  51. ds_json_encode(10001, lang('ds_common_del_fail'));
  52. }
  53. }
  54. /**
  55. * 用户中心右边,小导航
  56. *
  57. * @param string $menu_key 当前导航的menu_key
  58. * @return
  59. */
  60. protected function getMemberItemList()
  61. {
  62. $menu_array = array(
  63. 1 => array(
  64. 'name' => 'index', 'text' => lang('ds_arrivalnotice'),
  65. 'url' => (string)url('MemberArrivalnotice/index')
  66. )
  67. );
  68. return $menu_array;
  69. }
  70. }