TP3 2 搜尋分頁帶引數

2021-08-17 08:05:55 字數 1005 閱讀 1644

//商品列表頁面

public function index()

if($advertiser_id)

if($s1 && $e1 !=='')

$p_num= 2;

$count = d('apiproduct')->counts($where);// 查詢滿足要求的總記錄數

$page = new \think\page($count,$p_num);// 例項化分頁類 傳入總記錄數和每頁顯示的記錄數(25)

$page_begin= $page->firstrow;

//搜尋條件

$map['name'] = $name;

$map['start_time'] = $start_time;

$map['end_time'] = $end_times;

$map['advertiser_id'] = $advertiser_id;

$page->parameter = array_map('urldecode',$map);

$show = $page->show();// 分頁顯示輸出

$list = d('apiproduct')->alldatas($where,$page_begin,$p_num);

$wheres=;

$lists = d('apiadvertiser')->alldata($wheres);//查詢廣告主

$this->assign("page", $show);

$this->assign('list',$list);

$this->assign('name',$name);

$this->assign('options', $lists);

$this->assign('start', $start_time);

$this->assign('end', $end_times);

$this->display();

}

tp3 2復合查詢

where member.ming array like key where xueyuan.xingming array like key where xueyuan.dizhi array like key where xueyuan.shoujihao array like key where...

tp3 2自動驗證

namespace home model usethink model class usermodel extends model x u 使用者名稱長度為3 18位字元 2 password require 密碼不能為空 password a za z 0 9 a za z0 9 密碼格式不對 必...

tp3 2 語言切換

1 return array 3 1 lang switch on true,開啟語言包功能 2 lang auto detect true,自動偵測語言 開啟多語言功能後有效 3 lang list zh cn,en us 允許切換的語言列表 用逗號分隔 4 var language l 預設語言...