FranchiseeExamine.php 3.7 KB

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