当前位置: 首页>>代码示例>>PHP>>正文


PHP AbstractModel::search方法代码示例

本文整理汇总了PHP中AbstractModel::search方法的典型用法代码示例。如果您正苦于以下问题:PHP AbstractModel::search方法的具体用法?PHP AbstractModel::search怎么用?PHP AbstractModel::search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AbstractModel的用法示例。


在下文中一共展示了AbstractModel::search方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionSearch

 /**
  * created by Yosin
  */
 public function actionSearch()
 {
     $request = new Request();
     if ($request->searchGood != "") {
         $minLength = 2;
         $select = new SelectPDO();
         $select->from("lot", ["lot.*", "user.email", "user.phone"])->join("bid", "id", "lot_id")->join("user", "user_id", "id");
         $results = AbstractModel::search($select, ["title", "description"], $request->searchGood, $minLength, false, true);
     } else {
         $results = [];
     }
     if (!$results) {
         $results = [];
     }
     $this->view->lastGoods = $results;
     $this->view->render('search');
     $this->view->display();
 }
开发者ID:Kit-kat1,项目名称:Auction_bootstrap,代码行数:21,代码来源:page.php

示例2: searchProductWithCategory

 public function searchProductWithCategory($request, $category_id)
 {
     $minLength = 2;
     $this->select->from("lot", ["lot.*", "user.first_name", "user.last_Name", "user.phone", "user.email", "category.name"])->where("`lot`.`category_id` = ?", array($category_id))->join("user", "user_id", "id")->join("category", "category_id", "id");
     $result = AbstractModel::search($this->select, ['title', 'description'], $request->searchText, $minLength, false, true);
     return $result;
 }
开发者ID:Kit-kat1,项目名称:Auction_bootstrap,代码行数:7,代码来源:lot.php

示例3: searchProduct

 /**
  * search product
  *
  * @param $request
  * @param $id
  * @return array|bool
  */
 public static function searchProduct($request, $id)
 {
     $minLength = 2;
     $field = $request->field;
     if ($field == "lot") {
         $select = new SelectPDO();
         $select->from($field, "*")->where("`user_id` = ?", [$id]);
         $results = AbstractModel::search($select, ["title", "description"], $request->searchText, $minLength = 2, false, true);
     } else {
         if ($field == "bid") {
             $select = new SelectPDO();
             $select->from("lot", ["lot.*", "user.email", "user.phone"])->where("`bid`.`user_id` = ?", [$id])->join("bid", "id", "lot_id")->join("user", "user_id", "id");
             $results = AbstractModel::search($select, ["title", "description"], $request->searchText, $minLength, false, true);
         }
     }
     return $results;
 }
开发者ID:Kit-kat1,项目名称:Auction_bootstrap,代码行数:24,代码来源:myproduct.php


注:本文中的AbstractModel::search方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。