Shopreopen.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. <?php
  2. /**
  3. * Niushop商城系统 - 团队十年电商经验汇集巨献!
  4. * =========================================================
  5. * Copy right 2019-2029 山西牛酷信息科技有限公司, 保留所有权利。
  6. * ----------------------------------------------
  7. * 官方网址: https://www.niushop.com.cn
  8. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
  9. * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
  10. * =========================================================
  11. */
  12. namespace app\admin\controller;
  13. use app\model\shop\ShopReopen as ShopReopenModel;
  14. use app\model\shop\ShopGroup as ShopGroupModel;
  15. use app\model\shop\ShopCategory as ShopCategoryModel;
  16. use app\model\web\WebSite;
  17. /**
  18. * 店铺续签
  19. */
  20. class Shopreopen extends BaseAdmin
  21. {
  22. /******************************* 商家续签列表及相关操作 ***************************/
  23. /**
  24. * 商家申请续签列表
  25. */
  26. public function reopen()
  27. {
  28. $model = new ShopReopenModel();
  29. $condition = [];
  30. if (request()->isAjax()) {
  31. $page = input('page', 1);
  32. $page_size = input('page_size', PAGE_LIST_ROWS);
  33. $site_name = input('site_name', '');//店铺名称
  34. $category_id = input('category_id', '');//店铺类别id
  35. $group_id = input('group_id', '');//店铺等级id
  36. $site_id = input('site_id', '');//店铺等级id
  37. if ($site_id) {
  38. $condition[] = [ 'r.site_id', '=', $site_id ];
  39. }
  40. $apply_state = input('apply_state', '');
  41. if ($apply_state) {
  42. $condition[] = [ 'r.apply_state', '=', $apply_state ];
  43. }
  44. if ($site_name) {
  45. $condition[] = [ 's.site_name', 'like', '%' . $site_name . '%' ];
  46. }
  47. if ($category_id) {
  48. $condition[] = [ 's.category_id', '=', $category_id ];
  49. }
  50. if ($group_id) {
  51. $condition[] = [ 'r.shop_group_id', '=', $group_id ];
  52. }
  53. return $model->getApplyReopenPageList($condition, $page, $page_size);
  54. } else {
  55. $reopen_list = $model->getApplyReopenPageList($condition, 1, PAGE_LIST_ROWS);
  56. $this->assign('reopen_list', $reopen_list);
  57. //商家分类
  58. $shop_category_model = new ShopCategoryModel();
  59. $shop_category_list = $shop_category_model->getCategoryList([], 'category_id, category_name', 'sort asc');
  60. $this->assign('shop_category_list', $shop_category_list['data']);
  61. //店铺等级
  62. $shop_group_model = new ShopGroupModel();
  63. $shop_group_list = $shop_group_model->getGroupList([['is_own','=',0]], 'group_id,is_own,group_name,fee,remark', 'is_own asc,fee asc');
  64. $this->assign('shop_group_list', $shop_group_list['data']);
  65. $is_addon_city = addon_is_exit('city');
  66. $this->assign('is_addon_city',$is_addon_city);
  67. if($is_addon_city == 1){
  68. $website_model = new WebSite();
  69. $website_list = $website_model->getWebsiteList([],'site_id,site_area_name');
  70. $this->assign('website_list',$website_list['data']);
  71. }
  72. return $this->fetch('shopreopen/reopen');
  73. }
  74. }
  75. //查看续签详情
  76. public function reopendetail()
  77. {
  78. $model = new ShopReopenModel();
  79. $id = input('id', '');
  80. $info = $model->getReopenInfo([ [ 'id', '=', $id ] ]);
  81. $this->assign('info', $info);
  82. return $this->fetch('shopreopen/reopendetail');
  83. }
  84. /**
  85. * 申请续签通过
  86. */
  87. public function pass()
  88. {
  89. if (request()->isAjax()) {
  90. $model = new ShopReopenModel();
  91. $id = input('id', '');
  92. $site_id = input('site_id', '');
  93. $this->addLog("店铺续签审核通过站点id:" . $site_id);
  94. $result = $model->pass($id, $site_id);
  95. return $result;
  96. }
  97. }
  98. /**
  99. * 申请续签失败
  100. */
  101. public function fail()
  102. {
  103. if (request()->isAjax()) {
  104. $model = new ShopReopenModel();
  105. $id = input('id', '');
  106. $reason = input('reason', '');//拒绝原因
  107. $this->addLog("店铺续签审核拒绝id:" . $id);
  108. $result = $model->refuse($id, $reason);
  109. return $result;
  110. }
  111. }
  112. }