StatCgController.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. namespace ghs\controllers;
  3. use bizGhs\shop\classes\ShopAdminClass;
  4. use bizGhs\stat\classes\StatCgClass;
  5. use Yii;
  6. use common\components\util;
  7. class StatCgController extends BaseController
  8. {
  9. public function actionProfit()
  10. {
  11. ini_set('memory_limit', '2045M');
  12. set_time_limit(0);
  13. //查看财务的权限
  14. $lookMoney = ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop);
  15. if ($lookMoney == 0) {
  16. //util::fail('无法查看');
  17. }
  18. $mainId = $this->mainId;
  19. $respond = StatCgClass::statCg($mainId);
  20. $list = $respond['itemList'] ?? [];
  21. $staffCg = $respond['staffCg'] ?? [];
  22. util::success([
  23. 'list' => $list,
  24. 'staffCg' => $staffCg,
  25. 'nextDayDeduct' => $respond['nextDayDeduct'] ?? '0.00',
  26. ]);
  27. }
  28. //采购人业绩 ssh 2024412
  29. public function actionYj()
  30. {
  31. ini_set('memory_limit', '2045M');
  32. set_time_limit(0);
  33. //查看财务的权限
  34. $lookMoney = ShopAdminClass::lookMoneyPower($this->shopAdmin, $this->shop);
  35. if ($lookMoney == 0) {
  36. //util::fail('无法查看');
  37. }
  38. $mainId = $this->mainId;
  39. $respond = StatCgClass::statCgYj($mainId);
  40. $staffCg = $respond['staffCg'] ?? [];
  41. util::success([
  42. 'staffCg' => $staffCg,
  43. 'nextDayDeduct' => $respond['nextDayDeduct'] ?? '0.00',
  44. ]);
  45. }
  46. }