MemberArrivalnotice.php 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. namespace app\api\controller;
  3. use think\facade\Lang;
  4. /**
  5. * ============================================================================
  6. *
  7. * ============================================================================
  8. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  9. * 网站地址: https://www.valimart.net/
  10. * ----------------------------------------------------------------------------
  11. *
  12. * ============================================================================
  13. * 到货通知控制器
  14. */
  15. class MemberArrivalnotice extends MobileMember {
  16. public function initialize() {
  17. parent::initialize(); // TODO: Change the autogenerated stub
  18. Lang::load(base_path() . 'home/lang/' . config('lang.default_lang') . '/member_arrivalnotice.lang.php');
  19. }
  20. /**
  21. * @api {POST} api/MemberArrivalnotice/get_list 消息列表
  22. * @apiVersion 1.0.0
  23. * @apiGroup MemberArrivalnotice
  24. *
  25. * @apiHeader {String} X-DS-KEY 用户授权token
  26. *
  27. * @apiParam {Int} page 页码
  28. * @apiParam {Int} per_page 每页数量
  29. *
  30. * @apiSuccess {String} code 返回码,10000为成功
  31. * @apiSuccess {String} message 返回消息
  32. * @apiSuccess {Object} result 返回数据
  33. * @apiSuccess {Object[]} result.arrivalnotice_list 到货通知列表
  34. * @apiSuccess {Int} result.page_total 总页数
  35. * @apiSuccess {Boolean} result.hasmore 是否有更多 true是false否
  36. */
  37. public function get_list() {
  38. $arrivalnotice_model = model('arrivalnotice');
  39. $arrivalnotice_list = $arrivalnotice_model->getArrivalNoticeList(array('member_id' => $this->member_info['member_id']), '', '', '', $this->pagesize);
  40. ds_json_encode(10000, '', array_merge(array('arrivalnotice_list' => $arrivalnotice_list), mobile_page($arrivalnotice_model->page_info)));
  41. }
  42. public function del() {
  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. }