예제 #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getShop()
 {
     return $this->hasOne(Shop::className(), ['id' => 'shop_id']);
 }
예제 #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getShop()
 {
     return $this->hasOne(\common\models\Shop::className(), ['id' => 'shop_id']);
 }
예제 #3
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getShops()
 {
     return $this->hasMany(Shop::className(), ['category_id' => 'id']);
 }
예제 #4
0
 public function rules()
 {
     return ArrayHelper::merge(parent::rules(), [[['shop_id', 'date'], 'required'], [['shop_id', 'is_live'], 'integer'], [['notes'], 'string'], [['image'], 'safe'], [['shop_id'], 'exist', 'skipOnError' => true, 'targetClass' => Shop::className(), 'targetAttribute' => ['shop_id' => 'id']], [['date'], 'date', 'format' => 'php:Y-m-d']]);
 }