| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- // +----------------------------------------------------------------------
- // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 LARAVEL研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: laravel开发员 <laravel.qq.com>
- // +----------------------------------------------------------------------
- namespace App\Http\Controllers\Admin;
- use App\Http\Validator\ApiValidator;
- use App\Services\Common\ApiService;
- use App\Services\Common\NoticeService;
- use App\Services\Common\TradeOrderService;
- /**
- * 通知公告-控制器
- * Class ApiController
- * @package App\Http\Controllers
- */
- class ApiController extends Backend
- {
- /**
- * 构造函数
- * ApiController constructor.
- */
- public function __construct()
- {
- parent::__construct();
- $this->service = new ApiService();
- }
- /**
- * 接口账号列表
- * @return array
- */
- public function index()
- {
- $pageSize = request()->post('limit', 15);
- $params = request()->all();
- $list = ApiService::make()->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 order()
- {
- $params = request()->all();
- $pageSize = request()->post('limit', 15);
- $list = TradeOrderService::make()->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|mixed
- */
- public function edit()
- {
- $validate = new ApiValidator();
- $params = request()->post();
- $params = $validate->check($params,'edit');
- if(!is_array($params)){
- return returnJson($params, false,[]);
- }
- return $this->service->saveData($this->userId, $params);
- }
- }
|