/** * 定义与ActivityProduct的关联关系 */ public function getAproduct() { return $this->hasMany(ActivityProduct::className(), ['product_id' => 'id']); }
/** * 与中国好产品活动的关系 */ public function getAct() { return $this->hasOne(ActivityProduct::className(), ['id' => 'owner_id']); }