Arrivalnotice.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. namespace app\admin\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. * ============================================================================
  7. * DSMall多用户商城
  8. * ============================================================================
  9. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  10. * 网站地址: http://www.csdeshang.com
  11. * ----------------------------------------------------------------------------
  12. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  13. * 不允许对程序代码以任何形式任何目的的再发布。
  14. * ============================================================================
  15. * 控制器
  16. */
  17. class Arrivalnotice extends AdminControl
  18. {
  19. public function initialize() {
  20. parent::initialize();
  21. Lang::load(base_path() . 'admin/lang/'.config('lang.default_lang').'/arrivalnotice.lang.php');
  22. }
  23. /**
  24. * 到货通知列表
  25. * @return mixed
  26. */
  27. public function index() {
  28. $arrivalnotice_model = model('arrivalnotice');
  29. $condition = array();
  30. if (!empty(input('param.search_goods'))) {
  31. $condition[]=array('goods_name','like', '%' . input('param.search_goods') . '%');
  32. }
  33. if (!empty(input('param.search_state'))) {
  34. $condition[]=array('arrivalnotice_state','=',input('param.search_state'));
  35. }
  36. $arrivalnotice_list = $arrivalnotice_model->getArrivalNoticeList($condition,'','','',5);
  37. foreach ($arrivalnotice_list as $key => $value){
  38. $arrivalnotice_list[$key]['member_name'] = model('member')->getMemberInfo(['member_id'=>$value['member_id']],'member_name')['member_name'];
  39. }
  40. View::assign('arrivalnotice_list', $arrivalnotice_list);
  41. View::assign('show_page', $arrivalnotice_model->page_info->render());
  42. $this->setAdminCurItem('index');
  43. View::assign('filtered', $condition ? 1 : 0); //是否有查询条件
  44. return View::fetch();
  45. }
  46. /**
  47. * 到货通知删除
  48. */
  49. public function arrivalnotice_del(){
  50. $arrivalnotice_id = input('param.arrivalnotice_id');
  51. $arrivalnotice_id_array = ds_delete_param($arrivalnotice_id);
  52. if ($arrivalnotice_id_array == FALSE) {
  53. ds_json_encode('10001', lang('param_error'));
  54. }
  55. $condition = array();
  56. $condition[] = array('arrivalnotice_id','in',$arrivalnotice_id_array);
  57. $arrivalnotice_model = model('arrivalnotice');
  58. //批量删除
  59. $result = $arrivalnotice_model->delArrivalNotice($condition);
  60. if ($result){
  61. ds_json_encode(10000, lang('ds_common_del_succ'));
  62. }else{
  63. ds_json_encode(10001, lang('ds_common_del_fail'));
  64. }
  65. }
  66. }