添加:判断用户是否为代理人员
This commit is contained in:
parent
7f2c9fbf93
commit
95f49fa8a1
|
|
@ -7,6 +7,7 @@ namespace app\controller\api;
|
|||
|
||||
|
||||
use app\common\model\user\ExchangePickupPoint;
|
||||
use app\common\repositories\marketing\AgentRepository;
|
||||
use app\common\repositories\store\order\StoreOrderRepository;
|
||||
use app\common\repositories\store\order\StoreRefundOrderRepository;
|
||||
use app\common\repositories\system\notice\SystemNoticeConfigRepository;
|
||||
|
|
@ -162,6 +163,9 @@ class Auth extends BaseController
|
|||
}
|
||||
// 用户是否为兑换站点管理员
|
||||
$data['is_exchange_saff'] = app()->make(ExchangePickupPointRepository::class)->userIsStaff($user->uid);
|
||||
// 用户是否存在代理身份
|
||||
$agentCount = app()->make(AgentRepository::class)->getSearchModel(['uid'=>$user->uid])->count();
|
||||
$data['is_agent'] = $agentCount > 0;
|
||||
// 用户持有可用酒卡额度
|
||||
$data['available'] = (float)app()->make(ExchangeQuotaRepository::class)
|
||||
->searchModel(['uid'=>$user->uid])
|
||||
|
|
|
|||
Loading…
Reference in New Issue