<?php
|
|
namespace app\api\controller\plus\bonus;
|
|
use app\api\controller\Controller;
|
use app\common\model\plus\bonus\Setting;
|
use app\api\model\plus\bonus\User as bonusUserModel;
|
use app\common\exception\BaseException;
|
|
/**
|
* 队长申请
|
*/
|
class Bonus extends Controller
|
{
|
// 当前用户
|
private $user;
|
|
/**
|
* 构造方法
|
*/
|
public function initialize()
|
{
|
$this->user = $this->getUser(); // 用户信息
|
//分红设置
|
$this->setting = Setting::getAll();
|
}
|
|
/*
|
*获取队长协议
|
*/
|
public function canBuy()
|
{
|
$canBuy = Setting::isOpen() && Setting::isLimitBuy() && bonusUserModel::isBonusUser($this->user['user_id']);
|
$limit_word = $this->setting['basic']['values']['limit_word'];
|
return $this->renderSuccess('', compact('canBuy', 'limit_word'));
|
}
|
|
}
|