DashboardController.php 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: leo
  5. * Date: 2018/2/24
  6. * Time: 下午12:48
  7. */
  8. namespace backendApi\modules\v1\controllers;
  9. use common\helpers\Bonus;
  10. use common\helpers\ChartData;
  11. use common\helpers\Date;
  12. use common\helpers\Form;
  13. use common\models\FlowBonus;
  14. use common\models\Period;
  15. use common\models\UserInfo;
  16. class DashboardController extends BaseController
  17. {
  18. public $modelClass = FlowBonus::class;
  19. public function behaviors() {
  20. $behaviors = parent::behaviors();
  21. //$behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_JSON;
  22. return $behaviors;
  23. }
  24. /**
  25. * 控制台首页
  26. * @return mixed
  27. * @throws \yii\web\HttpException
  28. */
  29. public function actionIndex(){
  30. // print_r(\Yii::$app->user->validateAdminAction($this->id, $this->action->id));
  31. $nowTime = Date::nowTime();
  32. $period = Period::instance();
  33. $periodNum = $period->getNowPeriodNum();
  34. return static::notice([
  35. 'nowTime' => $nowTime,
  36. 'periodNum' => $periodNum,
  37. ]);
  38. }
  39. /**
  40. * 总累计的项目
  41. * @return array
  42. */
  43. public function actionTotalItem(){
  44. // $chart = ChartData::instance();
  45. // return [
  46. // 'totalBonus' => $chart->totalBonus(),
  47. // 'totalPerf' => $chart->totalPerf(),
  48. // 'totalWithdraw' => $chart->totalWithdraw(),
  49. // 'totalUser' => $chart->totalUser(),
  50. // ];
  51. return [];
  52. }
  53. /**
  54. * 会员注册量
  55. * @return mixed
  56. * @throws \yii\web\HttpException
  57. */
  58. public function actionRegNum(){
  59. $chartData = ChartData::instance();
  60. //$data = $chartData->getUserData();
  61. $data = [];
  62. return static::notice($data);
  63. }
  64. /**
  65. * 奖金量
  66. * @return mixed
  67. * @throws \yii\web\HttpException
  68. */
  69. public function actionBonusNum(){
  70. $chartData = ChartData::instance();
  71. // $data = $chartData->getBonusData();
  72. $data = [];
  73. return static::notice($data);
  74. }
  75. /**
  76. * 提现量
  77. * @return mixed
  78. * @throws \yii\web\HttpException
  79. */
  80. public function actionWithdrawNum(){
  81. $chartData = ChartData::instance();
  82. // $data = $chartData->getWithdrawData();
  83. $data = [];
  84. return static::notice($data);
  85. }
  86. }