/var/www/vhosts/nabawater/backend/models
Edit: /var/www/vhosts/nabawater/backend/models/OrderParcel.php (3315B)
function (self $model) {
$modelUser = User::find()->alias('U')
->select(['U.*'])
->where(['U.user_id' => $model->user_id]);
return $modelUser->asArray()->one();
},
'parcel_item_image' => function (self $model) {
$modelImage = OrderParcelItemImage::find()
->select(['*'])
->where(['order_parcel_id' => $model->order_parcel_id]);
return $modelImage->asArray()->all();
}
];
}
/**
*
* @param type $index
* @param type $condition
* @param type $delivery_type
* @return type
*/
public function getOrderStatus($index = '', $condition = '')
{
$orderArray = [];
if ($condition == OrderParcel::ORDER_STATUS_PENDING) {
$orderArray = [
OrderParcel::ORDER_STATUS_PENDING => Yii::t('backend', 'Pending'),
OrderParcel::ORDER_STATUS_ACCEPTED => Yii::t('backend', 'Accepted'),
OrderParcel::ORDER_STATUS_REJECTED => Yii::t('backend', 'Rejected'),
];
} else if ($condition == OrderParcel::ORDER_STATUS_ACCEPTED) {
$orderArray = [
OrderParcel::ORDER_STATUS_ACCEPTED => Yii::t('backend', 'Accepted'),
];
} else if ($condition == OrderParcel::ORDER_STATUS_REJECTED) {
$orderArray = [
OrderParcel::ORDER_STATUS_REJECTED => Yii::t('backend', 'Rejected'),
];
}
($index == '') ? ($orderArray = $orderArray) : ($orderArray = ArrayHelper::getValue($orderArray, $index));
return $orderArray;
}
/**
* @return array
*/
public function attributeLabels()
{
$attributeLabels = [
'order_booking_id' => yii::t('backend','Order Booking'),
'parcel_item_type_name' => yii::t('backend','Parcel Item Type'),
];
return ArrayHelper::merge(parent::attributeLabels(), $attributeLabels);
}
}