| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <?php
- // +----------------------------------------------------------------------
- // | LARAVEL8.0 框架 [ LARAVEL ][ RXThinkCMF ]
- // +----------------------------------------------------------------------
- // | 版权所有 2017~2021 LARAVEL研发中心
- // +----------------------------------------------------------------------
- // | 官方网站: http://www.laravel.cn
- // +----------------------------------------------------------------------
- // | Author: laravel开发员 <laravel.qq.com>
- // +----------------------------------------------------------------------
- namespace App\Http\Controllers\Admin;
- use App\Services\Common\AccountService;
- /**
- * 财务明细管理-控制器(基于 account_logs 表)
- * @author laravel开发员
- * @since 2020/11/11
- * Class AccountController
- * @package App\Http\Controllers
- */
- class AccountController extends Backend
- {
- /**
- * 列表
- */
- public function index()
- {
- $service = new AccountService();
- $params = request()->all();
- // 获取商家对应的 user_id 用于数据隔离
- if ($this->storeId) {
- $params['store_id'] = $this->storeId;
- }else if($this->memberId){
- $params['user_id'] = $this->memberId;
- }
- $result = $service->getDataList($params, $params['limit']);
- return [
- "msg" => $result['msg'] ?? '操作成功',
- "code" => $result['code'] ?? 0,
- "data" => $result['data'] ?? [],
- "count" => $result['count'] ?? 0,
- "counts" => $result['counts'] ?? []
- ];
- }
- /**
- * 获取详情
- */
- public function read()
- {
- $id = request()->input('id');
- if (empty($id)) {
- return showJson('参数错误', false);
- }
- $service = new AccountService();
- $result = $service->getInfo($id);
- return showJson($result['msg'], $result['code'] == 0, $result['data'] ?? []);
- }
- }
|