| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace App\Http\Controllers\Api;
- use App\Http\Validator\CoinValidator;
- use App\Services\Common\CoinLogService;
- /**
- * 币明细
- * Class CoinLogController
- * @package App\Http\Controllers\Api
- */
- class CoinLogController extends webApp
- {
- public function __construct()
- {
- parent::__construct();
- $this->service = new CoinLogService();
- }
- /**
- * 获取列表
- * @return array|mixed
- */
- public function index()
- {
- $pageSize = request()->post('pageSize', 15);
- $params = request()->all();
- if($this->userInfo['user_type'] == 2){
- $params['business_id'] = $this->userInfo['user_id'];
- }
- $list = $this->service->getDataList($params, $pageSize);
- return message(1002, true, $list);
- }
- /**
- * 提币
- * @return array
- */
- public function withdraw(CoinValidator $validate)
- {
- $params = request()->post();
- $params = $validate->check($params,'out');
- if(!is_array($params)){
- return message($params, false,[]);
- }
- $params['check_google'] = false;
- if(!CoinLogService::make()->withdraw($this->userId, $params)){
- return message(CoinLogService::make()->getError(), false);
- }else{
- return message(CoinLogService::make()->getError(), true);
- }
- }
- }
|