| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- namespace App\Http\Controllers\Admin;
- use App\Http\Validator\AdvertValidator;
- use App\Http\Validator\CoinValidator;
- use App\Services\Common\AdvertOrderService;
- use App\Services\Common\AdvertService;
- use App\Services\Common\CapitalLogService;
- use App\Services\Common\CoinLogService;
- /**
- * 币明细
- * Class CoinLogController
- * @package App\Http\Controllers\Admin
- */
- class CoinLogController extends Backend
- {
- public function __construct()
- {
- parent::__construct();
- $this->service = new CoinLogService();
- }
- /**
- * 获取列表
- * @return array|mixed
- */
- public function index()
- {
- $pageSize = request()->post('limit', 15);
- $params = request()->all();
- $params['user_id'] = isset($params['business_id'])? $params['business_id'] : 0;
- if($this->userInfo['user_type'] == 2 && empty($params['user_id'])){
- $params['user_id'] = $this->userInfo['user_id'];
- }
- $list = $this->service->getDataList($params, $pageSize);
- $message = array(
- "msg" => '操作成功',
- "code" => 0,
- "data" => isset($list['list'])? $list['list']:[],
- "count" => isset($list['total'])? $list['total']:0,
- );
- return $message;
- }
- /**
- * 提币
- * @return array
- */
- public function withdraw(CoinValidator $validate)
- {
- $params = request()->post();
- $params = $validate->check($params,'withdraw');
- if(!is_array($params)){
- return returnJson($params, false,[]);
- }
- if(!CoinLogService::make()->withdraw($this->userInfo['user_id'], $params)){
- return returnJson(CoinLogService::make()->getError(), false);
- }else{
- return returnJson(CoinLogService::make()->getError(), true);
- }
- }
- /**
- * 提币审核
- * @return array
- */
- public function confirm(CoinValidator $validate)
- {
- $params = request()->post();
- $params = $validate->check($params,'confirm');
- if(!is_array($params)){
- return returnJson($params, false,[]);
- }
- if(!CoinLogService::make()->confirmWithdraw($this->userId, $params)){
- return returnJson(CoinLogService::make()->getError(), false);
- }else{
- return returnJson(CoinLogService::make()->getError(), true);
- }
- }
- }
|