123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <?php
- namespace app\admin\controller;
- use app\model\member\FranchiseeExamine as FranchiseeExamineModel;
- use app\model\shop\ShopApply as ShopApplyModel;
- class FranchiseeExamine extends BaseAdmin
- {
- public function lists(){
- $franchisee_examine_model = new FranchiseeExamineModel();
- if(request()->isAjax()){
- $page_index = input('page', 1);
- $page_size = input('page_size', PAGE_LIST_ROWS);
- $status = input('status', "");
- $nature = input('nature', "");
- $condition = [];
- if ($status !== "") {
- $condition[] = [ 'status', '=', $status ];
- }
- if ($nature !== '') {
- $condition[] = [ 'nature', '=', $nature ];
- }
- $res = $franchisee_examine_model->getFranchiseeExaminePageList($condition, $page_index, $page_size);
- return $res;
- }else{
- return $this->fetch('franchiseeexamine/apply');
- }
- }
- public function index(){
- $franchisee_examine_model = new FranchiseeExamineModel();
- if(request()->isAjax()){
- $page_index = input('page', 1);
- $page_size = input('page_size', PAGE_LIST_ROWS);
- $status = input('status', "4");
- $nature = input('nature', "");
- $condition = [];
- if ($status !== "") {
- $condition[] = [ 'status', '=', $status ];
- }
- if ($nature !== '') {
- $condition[] = [ 'nature', '=', $nature ];
- }
- $res = $franchisee_examine_model->getFranchiseeExaminePageList($condition, $page_index, $page_size);
- return $res;
- }else{
- return $this->fetch('franchiseeexamine/index');
- }
- }
- /**
- * 申请通过
- */
- public function applyPass()
- {
- $apply_id = input('apply_id', 0);
- $member_id = input('member_id', 0);
- $shop_apply_model = new FranchiseeExamineModel();
- $this->addLog("商家申请通过id:" . $apply_id);
- return $shop_apply_model->applyPass($apply_id,$member_id);
- }
- /**
- * 申请失败
- */
- public function applyReject()
- {
- $apply_id = input('apply_id', 0);
- $reason = input('reason', 0);
- $this->addLog("商家申请拒绝id:" . $apply_id);
- $shop_apply_model = new FranchiseeExamineModel();
- return $shop_apply_model->applyReject($apply_id,$reason);
- }
- /**
- * 申请通过
- */
- public function statePass()
- {
- $apply_id = input('apply_id', 0);
- $shop_apply_model = new FranchiseeExamineModel();
- $this->addLog("操作启用商家id:" . $apply_id);
- return $shop_apply_model->statePass($apply_id);
- }
- /**
- * 申请失败
- */
- public function stateReject()
- {
- $apply_id = input('apply_id', 0);
- $this->addLog("操作禁用商家id:" . $apply_id);
- $shop_apply_model = new FranchiseeExamineModel();
- return $shop_apply_model->stateReject($apply_id);
- }
- /**
- * 申请失败
- */
- public function discount()
- {
- $apply_id = input('apply_id', 0);
- $discount = input('discount',0);
- $this->addLog("操作加盟商折扣id:" . $apply_id);
- $shop_apply_model = new FranchiseeExamineModel();
- return $shop_apply_model->discount($apply_id,$discount);
- }
- /**
- * 申请详情
- */
- public function applyDetail()
- {
- $apply_id = input('apply_id', 0);
- $shop_apply_model = new FranchiseeExamineModel();
- $apply_detail = $shop_apply_model->getApplyDetail($apply_id);
- $this->assign('apply_detail', $apply_detail['data']);
- return $this->fetch('franchiseeexamine/apply_detail');
- }
- }
|