SupplierExamine.php 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. namespace app\admin\controller;
  3. use app\model\member\SupplierExamine as SupplierExamineModel;
  4. class SupplierExamine extends BaseAdmin
  5. {
  6. public function lists(){
  7. $supplier_examine_model = new SupplierExamineModel();
  8. if(request()->isAjax()){
  9. $page_index = input('page', 1);
  10. $page_size = input('page_size', PAGE_LIST_ROWS);
  11. $status = input('status', "");
  12. $nature = input('nature', "");
  13. $condition = [];
  14. if ($status !== "") {
  15. $condition[] = [ 'status', '=', $status ];
  16. }
  17. if ($nature !== '') {
  18. $condition[] = [ 'nature', '=', $nature ];
  19. }
  20. $res = $supplier_examine_model->getSupplierExaminePageList($condition, $page_index, $page_size);
  21. return $res;
  22. }else{
  23. return $this->fetch('supplierexamine/apply');
  24. }
  25. }
  26. public function index(){
  27. $supplier_examine_model = new SupplierExamineModel();
  28. if(request()->isAjax()){
  29. $page_index = input('page', 1);
  30. $page_size = input('page_size', PAGE_LIST_ROWS);
  31. $status = input('status', "4");
  32. $nature = input('nature', "");
  33. $condition = [];
  34. if ($status !== "") {
  35. $condition[] = [ 'status', '=', $status ];
  36. }
  37. if ($nature !== '') {
  38. $condition[] = [ 'nature', '=', $nature ];
  39. }
  40. $res = $supplier_examine_model->getSupplierExaminePageList($condition, $page_index, $page_size);
  41. return $res;
  42. }else{
  43. return $this->fetch('supplierexamine/index');
  44. }
  45. }
  46. /**
  47. * 申请通过
  48. */
  49. public function applyPass()
  50. {
  51. $apply_id = input('apply_id', 0);
  52. $member_id = input('member_id', 0);
  53. $shop_apply_model = new SupplierExamineModel();
  54. $this->addLog("商家申请通过id:" . $apply_id);
  55. return $shop_apply_model->applyPass($apply_id,$member_id);
  56. }
  57. /**
  58. * 申请失败
  59. */
  60. public function applyReject()
  61. {
  62. $apply_id = input('apply_id', 0);
  63. $reason = input('reason', 0);
  64. $this->addLog("商家申请拒绝id:" . $apply_id);
  65. $shop_apply_model = new SupplierExamineModel();
  66. return $shop_apply_model->applyReject($apply_id,$reason);
  67. }
  68. public function statePass()
  69. {
  70. $apply_id = input('apply_id', 0);
  71. $shop_apply_model = new SupplierExamineModel();
  72. $this->addLog("操作启用商家id:" . $apply_id);
  73. return $shop_apply_model->statePass($apply_id);
  74. }
  75. /**
  76. * 申请失败
  77. */
  78. public function stateReject()
  79. {
  80. $apply_id = input('apply_id', 0);
  81. $this->addLog("操作禁用商家id:" . $apply_id);
  82. $shop_apply_model = new SupplierExamineModel();
  83. return $shop_apply_model->stateReject($apply_id);
  84. }
  85. /**
  86. * 申请详情
  87. */
  88. public function applyDetail()
  89. {
  90. $apply_id = input('apply_id', 0);
  91. $shop_apply_model = new SupplierExamineModel();
  92. $apply_detail = $shop_apply_model->getApplyDetail($apply_id);
  93. $apply_detail['data']['trademark_image'] = explode(',',$apply_detail['data']['trademark_image']);
  94. $this->assign('apply_detail', $apply_detail['data']);
  95. return $this->fetch('supplierexamine/apply_detail');
  96. }
  97. }