12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace api\float\controller;
- use api\common\controller\FloatBaseController;
- use huo\controller\gift\Gift;
- use huolib\status\GiftStatus;
- class GiftController extends FloatBaseController {
- public function _initialize() {
- parent::_initialize();
- }
-
- public function index() {
- $_game_id = $this->game_id;
- $_mem_id = $this->mem_id;
- $_gift_class = new Gift();
- $_ng_page = '1,10';
- $_normal_gift = $_gift_class->getNormalGifts($_game_id, $_mem_id, $_ng_page, true);
- if (GiftStatus::NO_ERROR != $_normal_gift['code']) {
- $_normal_gift = null;
- }
- $_rdata['normal_gift'] = $_normal_gift['data'];
- $_ng_page = '1,10';
- $_integral_gift = $_gift_class->getIntegralGifts($_game_id, $_mem_id, $_ng_page, true);
- if (GiftStatus::NO_ERROR != $_integral_gift['code']) {
- $_integral_gift = null;
- }
- $_rdata['integral_gift'] = $_integral_gift['data'];
- $_code = GiftStatus::NO_ERROR;
- $this->success(GiftStatus::getMsg($_code), $_rdata, $_code);
- }
-
- public function save() {
- $_mem_id = $this->mem_id;
- $_gift_id = $this->request->param('gift_id/d', 0);
- $_gift_class = new Gift();
- $_rs = $_gift_class->setGift($_mem_id, $_gift_id);
- if (GiftStatus::NO_ERROR != $_rs['code']) {
- $this->returnData($_rs);
- }
- $this->returnData($_rs);
- }
- }
|