'id = :id:', 'bind' => ['id' => $id], ]); } /** * @param string $phone * @return AccountModel|Model|bool */ public function findByPhone($phone) { return AccountModel::findFirst([ 'conditions' => 'phone = :phone:', 'bind' => ['phone' => $phone], ]); } /** * @param string $email * @return AccountModel|Model|bool */ public function findByEmail($email) { return AccountModel::findFirst([ 'conditions' => 'email = :email:', 'bind' => ['email' => $email], ]); } /** * @param array $ids * @param array|string $columns * @return ResultsetInterface|Resultset|AccountModel[] */ public function findByIds($ids, $columns = '*') { return AccountModel::query() ->columns($columns) ->inWhere('id', $ids) ->execute(); } }