1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- 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();
- }
-
- 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);
- $_offset = $this->request->param('offset/d', 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);
- }
-
- 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);
- }
-
- 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);
- }
- }
|