I am new in yii2. I don't know much about table relation. I have a 3 tables shops promotions and promotion_details. promotion_details contains promotion id and shop id. promotion has status like active or inactive. i want display in shop view only active promotions. How can i Do that? Thanks in advance
相关问题
- How to dynamically load partial view Via jquery aj
- what a part does bower/bower-asset play in php app
- how to get post value from multiple array in yii2
- Yii2 GridView with ArrrayDataProvider search
- passing a parameter to the link_to method
相关文章
- Can you run console jobs from yii2-basic?
- How to do a bulk database insert in Yii2?
- Forward request from servlet to jsp
- superclass mismatch for class CommentsController (
- How to send mail to multiple recipients in Yii2 ma
- Yii2 - check if the user is logged in view
- play2 framework my template is not seen. : package
- Render html in yii2 Gridview Widget
In you promotion_detail view add a getter function for relation and a getter function for the field
in view
this guide could be useful http://www.yiiframework.com/wiki/621/filter-sort-by-calculated-related-fields-in-gridview-yii-2-0/