Browse Source

申请开店

shish 6 years ago
parent
commit
6911e42dcb
2 changed files with 8 additions and 2 deletions
  1. 5 0
      app/www/controllers/ApplyController.php
  2. 3 2
      biz/saas/classes/ApplyClass.php

+ 5 - 0
app/www/controllers/ApplyController.php

@@ -2,6 +2,7 @@
 
 namespace www\controllers;
 
+use biz\admin\services\AdminService;
 use biz\saas\classes\ApplyClass;
 use biz\saas\services\ApplyService;
 use biz\saas\services\RegionService;
@@ -57,6 +58,10 @@ class ApplyController extends BaseController
 		if (!empty($apply)) {
 			util::fail('您已经申请过了');
 		}
+		$admin = AdminService::getByCondition(['platUserId' => $this->userId]);
+		if (!empty($admin)) {
+			util::fail('您已经开店了');
+		}
 		ApplyClass::addApply($get);
 		if ($rand == 0) {
 			$data = ['focus' => 0, 'qrCode' => 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3602624501,870193918&fm=26&gp=0.jpg'];

+ 3 - 2
biz/saas/classes/ApplyClass.php

@@ -28,8 +28,9 @@ class ApplyClass extends BaseClass
 			util::fail('您已经申请过了');
 		}
 		$prefix = $data['province'] == $data['city'] ? $data['province'] : $data['province'] . $data['city'];
-		$data['fullAddress'] = $prefix . $data['dist'] . $data['address'] . $data['floor'];
+		$dist = isset($data['dist']) ? $data['dist'] : '';
+		$data['fullAddress'] = $prefix . $dist . $data['address'] . $data['floor'];
 		return self::add($data);
 	}
-
+	
 }