123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <?php
- /**
- * InComeController.php UTF-8
- * 收入
- *
- * @date : 2018/9/13 10:24
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : wuyonghong <wyh@huosdk.com>
- * @version : HuoMp 1.0
- */
- namespace box\api\controller;
- use box\common\controller\V2ApiBaseController;
- use huo\model\user\UserModel;
- use huolib\constant\CommonConst;
- use huolib\constant\DataConst;
- use huolib\constant\WalletConst;
- use huolib\status\CommonStatus;
- use huolib\tool\RateLimit;
- use huomp\controller\finance\IncomeOut;
- use huomp\logic\finance\IncomeListLogic;
- class IncomeController extends V2ApiBaseController {
- public function _initialize() {
- parent::_initialize();
- $this->checkLogin();
- $_rs = (new RateLimit())->rateLimit($this->mem_id);
- if (false == $_rs) {
- $_code = CommonStatus::TOO_MANY_REQUESTS;
- $this->error(CommonStatus::getMsg($_code));
- }
- }
- /**
- * 分享收益排行912
- * http://doc.1tsdk.com/159?page_id=4640
- * 【域名】/share/income/rank
- */
- public function getRankIndex() {
- $_range = get_val($this->rq_data, 'range', DataConst::RANK_RANGE_WEEK);
- $_type = get_val($this->rq_data, 'type', WalletConst::WALLET_RP);
- $_page = get_val($this->rq_data, 'page', 1);
- $_offset = get_val($this->rq_data, 'offset', 10);
- if ($_page * $_offset > CommonConst::CONST_MAX_TASK_CNT) { //最多查找100个数据
- $_code = CommonStatus::NO_ERROR;
- $this->success(CommonStatus::getMsg($_code), [], $_code);
- }
- $_param = [
- 'range' => $_range,
- 'type' => $_type
- ];
- $_page = $_page.','.$_offset;
- $_agent_id = (new UserModel())->getIdByMemId($this->mem_id);
- $_data = (new IncomeListLogic())->incomeRankList($_agent_id, $_param, $_page);
- $_code = CommonStatus::NO_ERROR;
- $this->success(CommonStatus::getMsg($_code), $_data, $_code);
- }
- public function getTestData() {
- return [
- 'my_integral' => 100,
- 'gain_integral' => 10,
- 'gain_amount' => 1,
- 'balance' => 0.1,
- ];
- }
- /**
- * 领取签到奖励0912
- * http://doc.1tsdk.com/159?page_id=4641
- * 【域名】/sign/income/add
- */
- public function getSignMoney() {
- $_game_rq = $this->setGameData();
- $_rdata = (new IncomeOut())->getSignIncome($this->mem_id, $_game_rq->getHAppId());
- $this->returnData($_rdata);
- }
- /**
- * 领取分享奖励0912
- * http://doc.1tsdk.com/159?page_id=4642
- * 【域名】/share/income/get
- */
- public function getShareMoney() {
- $_game_rq = $this->setGameData();
- $_rdata = (new IncomeOut())->getShareIncome($this->mem_id, $_game_rq->getHAppId());
- $this->returnData($_rdata);
- }
- /**
- * 领取试玩奖励0912
- * http://doc.1tsdk.com/159?page_id=4643
- * 【域名】/play/income/get
- */
- public function getPlayMoney() {
- $_game_rq = $this->setGameData();
- $_rdata = (new IncomeOut())->getPlayIncome($this->mem_id, $_game_rq->getHAppId());
- $this->returnData($_rdata);
- }
- /**
- * 领取游戏奖励0912
- * http://doc.1tsdk.com/159?page_id=4644
- * 【域名】/game/income/get
- */
- public function getGameMoney() {
- $_rdata = (new IncomeOut())->getGameIncome($this->mem_id);
- $this->returnData($_rdata);
- }
- /**
- * 安卓桌面打开小程序奖励915
- * http://doc.1tsdk.com/159?page_id=4652
- * 域名】/favorite/reward/get
- */
- public function getFavorite() {
- $_game_rq = $this->setGameData();
- $_rdata = (new IncomeOut())->getFavoriteIncome($this->mem_id, $_game_rq->getHAppId());
- $this->returnData($_rdata);
- }
- }
|