| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace app\controller\merchant;
- use app\extra\basic\Base;
- use app\middleware\AuthMiddleware;
- use app\model\saas\SaasStore;
- use app\service\saas\DepositService;
- use DI\Attribute\Inject;
- use LinFly\Annotation\Attributes\Route\Controller;
- use LinFly\Annotation\Attributes\Route\GetMapping;
- use LinFly\Annotation\Attributes\Route\Middleware;
- use support\Request;
- use support\Response;
- /**
- * 保证金
- */
- #[Controller("/api/merchant/deposit"),Middleware(AuthMiddleware::class)]
- class Deposit extends Base
- {
- #[Inject]
- protected DepositService $service;
- #[GetMapping('list')]
- public function getDataList(Request $request): Response
- {
- try {
- $param = $request->all();
- $param['poi_id'] = $request->user['store_id'];
- $data = $this->service->setModel()->getList($param);
- return successTrans(100010,pageFormat($data),200);
- } catch (\Throwable $th) {
- return error($th->getMessage());
- }
- }
- #[GetMapping('data')]
- public function getDepositData(Request $request): Response
- {
- try {
- $deposit = (new SaasStore)->where("poi_id",$request->user['store_id'])->value("deposit");
- return success('ok',compact("deposit"));
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- }
|