1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- /**
- * AccountController.php UTF-8
- *
- *
- * @date : 2018/6/1 17:10
- *
- * @license 这不是一个自由软件,未经授权不许任何使用和传播。
- * @author : luowei <lw@huosdk.com>
- * @version : HUOSDK 8.0
- */
- namespace api\cfloat\controller;
- use api\common\controller\CFloatBaseController;
- use huoAccountDeal\controller\MemGameOut;
- use think\Lang;
- class AccountController extends CFloatBaseController {
- public function _initialize() {
- parent::_initialize();
- $langSet = $this->request->langset();
- Lang::load([APP_PATH.'cfloat'.DS.'lang'.DS.$langSet.DS.'account'.EXT,]);
- $this->checkLogin();
- }
- /**
- * 小号列表
- * http://doc.1tsdk.com/138?page_id=3395
- * 【域名】/cfloat/account/list
- */
- public function index() {
- $_param = $this->request->param();
- $_result = $this->validate($_param, 'Account.list');
- if ($_result !== true) {
- $this->error($_result);
- }
- $_page = $this->request->param('page/d', 1); /* 页码 默认为1 代表第一页 1 */
- $_offset = $this->request->param('offset/d', 10); /* 每页显示数量 默认为10 */
- $_app_id = $this->request->param('app_id/d');
- $_page = $_page.','.$_offset;
- $_account_list = (new MemGameOut())->getAccountList($this->mem_id, $_app_id, $_page);
- $this->returnData($_account_list);
- }
- /**
- * 添加小号
- * http://doc.1tsdk.com/138?page_id=3396
- * 【域名】/cfloat/account/add
- */
- public function add() {
- $_param = $this->request->param();
- $_result = $this->validate($_param, 'Account.add');
- if ($_result !== true) {
- $this->error($_result);
- }
- $_mem_id = $this->mem_id;
- $_app_id = $this->request->param('app_id/d');
- $_nickname = $this->request->param('nickname/s');
- $_rs = (new MemGameOut())->addAccount($_mem_id, $_app_id, $_nickname);
- $this->returnData($_rs);
- }
- /**
- * 切换小号
- * http://doc.1tsdk.com/138?page_id=3397
- * 【域名】/cfloat/account/change
- */
- public function change() {
- $_param = $this->request->param();
- $_result = $this->validate($_param, 'Account.change');
- if ($_result !== true) {
- $this->error($_result);
- }
- $_mem_id = $this->mem_id;
- $_app_id = $this->request->param('app_id/d');
- $_account_id = $this->request->param('mg_mem_id/d');
- $_rs = (new MemGameOut())->changeAccount($_mem_id, $_app_id, $_account_id);
- $this->returnData($_rs);
- }
- }
|