ApplyController.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace ghs\controllers;
  3. use biz\saas\classes\ApplyExtendClass;
  4. use bizTy\sj\classes\MerchantClass;
  5. use bizGhs\shop\services\ShopAdminService;
  6. use biz\saas\services\ApplyService;
  7. use biz\wx\services\WxBaseService;
  8. use biz\wx\services\WxOpenService;
  9. use common\components\stringUtil;
  10. use Yii;
  11. use common\components\util;
  12. use biz\admin\services\AdminService;
  13. use biz\saas\classes\ApplyClass;
  14. use biz\saas\services\RegionService;
  15. use yii\web\Controller;
  16. class ApplyController extends BaseController
  17. {
  18. //邀请开店列表 shish 2021.1.28
  19. public function actionList()
  20. {
  21. $get = Yii::$app->request->get();
  22. $where = [];
  23. $where['introSjId'] = $this->sjId;
  24. $status = $get['status'] ?? 0;
  25. $style = $get['style'] ?? MerchantClass::STYLE_SUPPLIER;
  26. if (!empty($status)) {
  27. $where['status'] = $status;
  28. }
  29. $where['style'] = $style;
  30. $data = ApplyService::getApplyList($where);
  31. util::success($data);
  32. }
  33. //申请试用,花店添加新客户 shish 2021.1.8
  34. public function actionRegister()
  35. {
  36. $post = Yii::$app->request->post();
  37. $post['adminId'] = $this->adminId;
  38. $post['long'] = isset($post['longitude']) ? $post['longitude'] : '';
  39. $post['lat'] = isset($post['latitude']) ? $post['latitude'] : '';
  40. $post['from'] = ApplyClass::FROM_GHS;
  41. $post['certType'] = ApplyClass::CERT_TYPE_LICENSE;
  42. //增加或更新申请
  43. ApplyService::addGhsApply($post);
  44. util::complete();
  45. }
  46. //申请状态
  47. public function actionApplyStatus()
  48. {
  49. //-1申请试用 0审核中 1审核通过、试用中 2审核未通过 3已付费,立即订购 4试用到期失效,待付款,立即订购,价格不显示
  50. $status = -1;
  51. util::success(['status' => $status]);
  52. }
  53. //地图相关信息 shish 2020.1.14
  54. public function actionRegionRelate()
  55. {
  56. $regionTree = RegionService::tree();
  57. $mapKey = 'OFWBZ-2NTHP-EHNDD-LKWQY-GANM7-PXBJH';
  58. $out = ['region' => $regionTree, 'txMapKey' => $mapKey];
  59. util::success($out);
  60. }
  61. //获取申请的验证码 shish 2020.2.23
  62. public function actionGetValidateCode()
  63. {
  64. $mobile = Yii::$app->request->get('mobile');
  65. util::success(['code' => rand(1111, 9999)]);
  66. }
  67. }