芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/airport-back/controllers/DashboardController.php
<?php namespace app\controllers; use Yii; use yii\base\Controller; use yii\helpers\ArrayHelper; use app\models\Customer; use app\models\Payment; class DashboardController extends Controller{ public function actionIndex(){ $now=date('Y-m-d'); $customers=Customer::find()->count(); $payments=Payment::find()->where(['DATE_FORMAT(payment_date,"%Y-%m-%d")'=>$now])->sum('amount'); return ['customers'=>$customers,'payments'=>$payments]; } }