Added in_usermenu field for RecipeModel
This commit is contained in:
parent
b854c92377
commit
81a88b93d5
@ -18,6 +18,7 @@ class RecipeModel extends BaseModel
|
||||
public $category_name;
|
||||
public $author_username;
|
||||
public $is_in_favorite = 0;
|
||||
public $in_usermenu = false;
|
||||
|
||||
const STATUS = [['publish', 'Publish'], ['pending', 'Pending']];
|
||||
|
||||
@ -70,6 +71,16 @@ class RecipeModel extends BaseModel
|
||||
]
|
||||
));
|
||||
}
|
||||
if(CURRENT_USER) {
|
||||
$add_fields = array_merge($add_fields, array(
|
||||
[
|
||||
"field" => [
|
||||
"MAX(m.dayofweek) AS in_usermenu"
|
||||
],
|
||||
"join_table" => "recipe_usermenu m ON m.recipe_id = obj.id AND m.user_id = " . CURRENT_USER->get_id()
|
||||
]
|
||||
));
|
||||
}
|
||||
|
||||
return $add_fields;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user