| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- namespace App\Http\Controllers\Api;
- use App\Http\Validator\CoinValidator;
- use App\Services\Api\AdvertService;
- use App\Services\Api\MemberWalletService;
- use App\Services\Common\CoinLogService;
- /**
- * 用户地址簿
- * Class WalletController
- * @package App\Http\Controllers\Api
- */
- class WalletController extends webApp
- {
- /**
- * 获取列表
- * @return array|mixed
- */
- public function index()
- {
- $pageSize = request()->post('pageSize', 15);
- $type = request()->post('type', 1);
- $list = MemberWalletService::make()->getOptionList($this->userId, $type, $pageSize);
- return message(1010, true, $list);
- }
- /**
- * 提币
- * @return array
- */
- public function withdraw(CoinValidator $validate)
- {
- $params = request()->post();
- $params = $validate->check($params,'withdraw');
- if(!is_array($params)){
- return message($params, false,[]);
- }
- if(!CoinLogService::make()->withdraw($this->userInfo['user_id'], $params)){
- return message(CoinLogService::make()->getError(), false);
- }else{
- return message(CoinLogService::make()->getError(), true);
- }
- }
- public function add()
- {
- }
- public function del()
- {
- }
- }
|