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