Arrivalnotice.php 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. namespace app\admin\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. * ============================================================================
  7. *
  8. * ============================================================================
  9. * 版权所有 2014-2028 浙江惠利玛产业互联网有限公司,并保留所有权利。
  10. * 网站地址: https://www.valimart.net/
  11. * ----------------------------------------------------------------------------
  12. *
  13. * ============================================================================
  14. * 控制器
  15. */
  16. class Arrivalnotice extends AdminControl
  17. {
  18. public function initialize() {
  19. parent::initialize();
  20. Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/arrivalnotice.lang.php');
  21. }
  22. /**
  23. * 到货通知列表
  24. * @return mixed
  25. */
  26. public function index() {
  27. $arrivalnotice_model = model('arrivalnotice');
  28. $condition = array();
  29. if (!empty(input('param.search_goods'))) {
  30. $condition[]=array('goods_name','like', '%' . input('param.search_goods') . '%');
  31. }
  32. if (!empty(input('param.search_state'))) {
  33. $condition[]=array('arrivalnotice_state','=',input('param.search_state'));
  34. }
  35. $arrivalnotice_list = $arrivalnotice_model->getArrivalNoticeList($condition,'','','',5);
  36. foreach ($arrivalnotice_list as $key => $value){
  37. $arrivalnotice_list[$key]['member_name'] = model('member')->getMemberInfo(['member_id'=>$value['member_id']],'member_name')['member_name'];
  38. }
  39. View::assign('arrivalnotice_list', $arrivalnotice_list);
  40. View::assign('show_page', $arrivalnotice_model->page_info->render());
  41. $this->setAdminCurItem('index');
  42. View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
  43. return View::fetch();
  44. }
  45. /**
  46. * 到货通知删除
  47. */
  48. public function arrivalnotice_del(){
  49. $arrivalnotice_id = input('param.arrivalnotice_id');
  50. $arrivalnotice_id_array = ds_delete_param($arrivalnotice_id);
  51. if ($arrivalnotice_id_array == FALSE) {
  52. ds_json_encode('10001', lang('param_error'));
  53. }
  54. $condition = array();
  55. $condition[] = array('arrivalnotice_id','in',$arrivalnotice_id_array);
  56. $arrivalnotice_model = model('arrivalnotice');
  57. //批量删除
  58. $result = $arrivalnotice_model->delArrivalNotice($condition);
  59. if ($result){
  60. ds_json_encode(10000, lang('ds_common_del_succ'));
  61. }else{
  62. ds_json_encode(10001, lang('ds_common_del_fail'));
  63. }
  64. }
  65. }