public function actionItemsenbale($organization_id) {
$items = Item::updateAll(['is_rtm_enable' => SharedConstant::VALUE_ZERO])->andWhere(['organization_id' => $organization_id]);
return (new ApiResponse)->success(['item' => $items]);
}
public function actionItemsenbale($organization_id) {
$items = Item::updateAll(['is_rtm_enable' => SharedConstant::VALUE_ZERO])->andWhere(['organization_id' => $organization_id]);
return (new ApiResponse)->success(['item' => $items]);
}
2
Answers
updateAll
does not return data. It only returns the count of data that was updated.After you check if data was updated, do another
find()
with your filters and return that.I am only guessing your query as I dont know
ApiResponse
and weather it accepts Item objects or just array like->asArray()->all()
.