->with('items')
->with('status1C')
->where(['store_id' => $storeId])
- ->andWhere(['status_1c' => MarketplaceOrders::STATUSES_1C_CREATED_IN_1C])
+ ->andWhere(['IS NOT', 'status_processing_1c', null])
->andWhere(['>=', 'creation_date', $startTime->format('Y-m-d H:i:s')])
->andWhere(['<=', 'creation_date', $currentTime->format('Y-m-d H:i:s')])
->orderBy(['id' => SORT_DESC])
*/
protected function findModel($id)
{
- if (($model = MarketplaceOrders::findOne(['id' => $id])) !== null) {
+ $model = MarketplaceOrders::find()
+ ->with([
+ 'status1C',
+ 'items',
+ ])
+ ->where(['id' => $id])
+ ->one();
+
+ if ($model !== null) {
return $model;
}
public function search($params, $formName = null)
{
$query = MarketplaceOrders::find()
+ ->with('status1C')
->joinWith(['store', 'status statusAlias', 'substatus substatusAlias']);
$dataProvider = new ActiveDataProvider([
[
'attribute' => 'status_processing_1c',
'value' => function ($model) {
- return $model->status1c->status ?? null;
+ return $model->status1C->status ?? null;
}
],
[
],
[
'attribute' => 'status_processing_1c',
- 'value' => function ($model) {
- return $model->status1c->status ?? null;
- }
+ 'value' => $model->status1C->status ?? null
+
],
[
'attribute' => 'cancelled_order_sent',