AccountController.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. namespace app\workerapi\controller;
  3. use app\workerapi\lists\MasterWorkerAccountLogLists;
  4. use app\workerapi\lists\MasterWorkerCaseOutLogLists;
  5. use app\workerapi\logic\AccountLogic;
  6. use app\workerapi\validate\AccountLogValidate;
  7. class AccountController extends BaseApiController
  8. {
  9. public function totalAssets()
  10. {
  11. $result = AccountLogic::totalAssets(['worker_id' => $this->userId]);
  12. if (false === $result) {
  13. return $this->fail(AccountLogic::getError());
  14. }
  15. return $this->success('操作成功',$result, 1, 0);
  16. }
  17. public function accountLogLists()
  18. {
  19. return $this->dataLists(new MasterWorkerAccountLogLists());
  20. }
  21. public function caseOutLists()
  22. {
  23. return $this->dataLists(new MasterWorkerCaseOutLogLists());
  24. }
  25. public function monthAccountWithCaseOutTotal()
  26. {
  27. $params = (new AccountLogValidate())->get()->goCheck('monthAccountWithCaseOutTotal',['worker_id'=>$this->userId]);
  28. $result = AccountLogic::monthAccountWithCaseOutTotal($params);
  29. if (false === $result) {
  30. return $this->fail(AccountLogic::getError());
  31. }
  32. return $this->success('操作成功',$result, 1, 0);
  33. }
  34. }