model = new ApplyModel(); } public function cancelGame($gameId, $promoteId) { $ids = [$promoteId]; $list = M('promote', 'tab_')->field('id')->where('parent_id=' . $promoteId . ' or grand_id=' . $promoteId)->select(); $ids = array_merge($ids, array_column($list, 'id')); $save['offline_status'] = 1; M('apply', 'tab_')->where(['game_id' => $gameId, 'promote_id' => ['in', $ids]])->save($save); } }