100], [['price'], 'string', 'max' => 50], [['remark'], 'string', 'max' => 200], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'type_id' => 'Type ID', 'name' => 'Name', 'price' => 'Price', 'remark' => 'Remark', 'total' => 'Total', 'total_lock' => 'Total Lock', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } public function getType() { return $this->hasOne(GiftTypeT::className(),['id'=>'type_id']); } public function getStrategys() { return $this->hasMany(StrategyT::className(),['id'=>'strategy_id']) ->viaTable('gift_strategy_t',['gift_id'=>'id']); } }