MemberArrivalnotice.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace app\api\controller;
  3. use think\facade\Lang;
  4. /**
  5. *
  6. *
  7. * ----------------------------------------------------------------------------
  8. *
  9. * 到货通知控制器
  10. */
  11. class MemberArrivalnotice extends MobileMember
  12. {
  13. public function initialize()
  14. {
  15. parent::initialize(); // TODO: Change the autogenerated stub
  16. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/member_arrivalnotice.lang.php');
  17. }
  18. /**
  19. * @api {POST} api/MemberArrivalnotice/get_list 消息列表
  20. * @apiVersion 1.0.0
  21. * @apiGroup MemberArrivalnotice
  22. *
  23. * @apiHeader {String} X-DS-KEY 用户授权token
  24. *
  25. * @apiParam {Int} page 页码
  26. * @apiParam {Int} per_page 每页数量
  27. *
  28. * @apiSuccess {String} code 返回码,10000为成功
  29. * @apiSuccess {String} message 返回消息
  30. * @apiSuccess {Object} result 返回数据
  31. * @apiSuccess {Object[]} result.arrivalnotice_list 到货通知列表
  32. * @apiSuccess {Int} result.page_total 总页数
  33. * @apiSuccess {Boolean} result.hasmore 是否有更多 true是false否
  34. */
  35. public function get_list()
  36. {
  37. $arrivalnotice_model = model('arrivalnotice');
  38. $arrivalnotice_list = $arrivalnotice_model->getArrivalNoticeList(array('member_id' => $this->member_info['member_id']), '', '', '', $this->pagesize);
  39. ds_json_encode(10000, '', array_merge(array('arrivalnotice_list' => $arrivalnotice_list), mobile_page($arrivalnotice_model->page_info)));
  40. }
  41. public function del()
  42. {
  43. $arrivalnotice_id = input('param.arrivalnotice_id');
  44. $arrivalnotice_id_array = ds_delete_param($arrivalnotice_id);
  45. if ($arrivalnotice_id_array == FALSE) {
  46. ds_json_encode('10001', lang('param_error'));
  47. }
  48. $condition = array(array('member_id', '=', $this->member_info['member_id']));
  49. $condition[] = array('arrivalnotice_id', 'in', $arrivalnotice_id_array);
  50. $arrivalnotice_model = model('arrivalnotice');
  51. //批量删除
  52. $result = $arrivalnotice_model->delArrivalNotice($condition);
  53. if ($result) {
  54. ds_json_encode(10000, lang('ds_common_op_succ'));
  55. } else {
  56. ds_json_encode(10001, lang('ds_common_op_fail'));
  57. }
  58. }
  59. }