From b233bf7e8b4883a9d0bd397d9959921d9029f7de Mon Sep 17 00:00:00 2001 From: wangxinglong <2371974647@qq.com> Date: Tue, 8 Feb 2022 16:38:36 +0800 Subject: [PATCH] setter --- app/controller/api/Coupon.php | 2 +- app/controller/api/User.php | 12 +++++++----- app/model/Business.php | 2 ++ 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/app/controller/api/Coupon.php b/app/controller/api/Coupon.php index d2fdffd..13aebe8 100644 --- a/app/controller/api/Coupon.php +++ b/app/controller/api/Coupon.php @@ -680,7 +680,7 @@ class Coupon extends Base if ($hasCouponMax > 0) { $hasCouponCount = CouponRepository::getInstance()->getBusinessOnShelfOnCount($account->business->code); if ($hasCouponCount > $hasCouponMax) { - return $this->json(4001, "商家持有商家优惠券不能超过{$hasCouponMax}"); + return $this->json(4001, "商家持有优惠券不能超过{$hasCouponMax}"); } } diff --git a/app/controller/api/User.php b/app/controller/api/User.php index 927293f..39d5235 100644 --- a/app/controller/api/User.php +++ b/app/controller/api/User.php @@ -3,6 +3,7 @@ namespace app\controller\api; use app\exception\RepositoryException; use app\model\Account; +use app\model\Business; use app\repository\AccountRepository; use app\repository\BusinessRepository; use app\repository\CouponRepository; @@ -234,13 +235,14 @@ class User extends Base // } // // } - + $personalRes['business'] =[ + "state" => Business::state_consumer,//未认证 + "reason" => "",//未认证 + ]; if(!empty($account['business'])) { // 商户认证记录 - $personalRes['business'] = [ - 'state' => $account['business']['state'], - 'reason' => $account['business']['reason'], - ]; + $personalRes['business']["state"] = $account['business']['state']; + $personalRes['business']["reason"] = $account['business']['reason']; } return $this->json(0, 'success', $personalRes); diff --git a/app/model/Business.php b/app/model/Business.php index 189c965..6d3e6d2 100644 --- a/app/model/Business.php +++ b/app/model/Business.php @@ -6,9 +6,11 @@ use think\model\relation\HasOne; class Business extends Base { + const state_reviewing = 0;//待审核 const state_on = 1;//审核通过 const state_off = 2;//驳回 + const state_consumer = 4;//未认证 const model_ordinary = 0;//普通商家 const model_annual_fee = 1;//年费商家