namespace app\controllers;
+use yii_app\records\MarketplaceOrders;
use yii_app\records\MarketplaceStatus;
class MarketplaceController extends BaseController
$this->response->format = \yii\web\Response::FORMAT_JSON;
return ['response' => MarketplaceStatus::find()->asArray()->all()];
}
+
+ public function actionGetNewOrderCount() {
+ return ['response' => MarketplaceOrders::find()
+ ->where([
+ 'status_1c' => 1,
+ 'status_id' => 1,
+ ])->andWhere([
+ 'between',
+ 'creation_date',
+ date('Y-m-d 00:00:00', strtotime('-3 days', time())),
+ date('Y-m-d 23:59:59', time())
+ ])
+ ->count()
+ ];
+ }
}
\ No newline at end of file