where("user_id", $uid) ->where("bar_id", $barId) ->where("is_del", false) ->first(); if (!$data) { return "nothing to remove"; } $this->is_del = true; $this->where("user_id", $uid) ->where("bar_id", $barId) ->where("is_del", false) ->update(["is_del" => true]); return "success"; } /** * @param $uid * @return array */ public function ListActionBarIds($uid) { $bars = $this->select("bar_id") ->where("user_id", $uid) ->where("status", "normal") ->where("is_del", false) ->get(); if (count($bars) == 0) { return []; } $bar_ids = []; foreach ($bar_ids as $bar_id) { array_push($bar_ids, $bar_id->bar_id); } return $bar_ids; } }