Commit a4b8aa8b authored by clone's avatar clone

分页和bug

parent 00a1a03a
......@@ -34,16 +34,21 @@ class AttentionShop extends Basic
public function addOrUpdateAttention()
{
$params = $this->params;
/* $params = array(
// "id" => 2,
"user_id" => 3,
"house_id" => 2,
// "is_del" => 0
);*/
/* $params = array(
// "id" => 2,
"user_id" => 4,
"house_id" => 2,
// "is_del" => 0
);*/
$msg = isset($params['id']) ? "修改" : "新增";
$result = $this->attentionModel->addOrUpdateAttentionShop($params);
if ($result['code'] == 200) {
return $this->response("200", $msg . "成功", $result["msg"]);
$arr = array(
"isAdd" => isset($params['id']) ? false : true,
"id" => $result["msg"]
);
return $this->response("200", $msg . "成功", $arr);
} else {
return $this->response("101", $msg . $result["msg"]);
}
......
......@@ -197,7 +197,10 @@ class Shop extends Basic
$cityList = $this->db->getCityList($field, $param, $group_);
foreach ($cityList as $k => $v) {
$cityArr[] = $v["city"];
if (!empty($v["city"])) {
$cityArr[] = $v["city"];
}
}
$cityArr = array_unique($cityArr);
$i = 0;
......@@ -233,7 +236,6 @@ class Shop extends Basic
}
}
}
return $this->response("200", "request success", $result);
}
}
\ No newline at end of file
......@@ -39,12 +39,13 @@ class TradeLog extends Basic
public function getTradeList()
{
$params = $this->params;
$param = array(
/* $params = array(
"user_id" => "1",
"phone" => "158****6165",
"pageNo" => 1,
"pageSize" => 15,
);
);*/
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
......@@ -52,7 +53,7 @@ class TradeLog extends Basic
$field = "a.id,a.tradecode,a.singntime,b.phpone,b.house_id,b.agent_id";
$result = $this->journalAccountsMode->getJournalAccountsList($pageNo, $pageSize, $order_, $field, $param);
$result = $this->journalAccountsMode->getJournalAccountsList($pageNo, $pageSize, $order_, $field, $params);
if (count($result) <= 0) {
return $this->response("200", "请求数据为空");
}
......@@ -64,7 +65,7 @@ class TradeLog extends Basic
$imgParam["house_id"] = $val["house_id"];
$imgParam["imgtype"] = 1; //默认主图
$result[$key]["images"] = $this->dbImg->getHouseImages($imgParam, 1);
$evaluateResult = $this->evaluateMode->getIsEvaluate(20, $val["house_id"], $param["user_id"]);
$evaluateResult = $this->evaluateMode->getIsEvaluate(20, $val["id"], $params["user_id"]);
$result[$key]["is_evaluate"] = count($evaluateResult) > 0 ? 1 : 0;
}
return $this->response("200", "request", $result);
......
......@@ -79,7 +79,7 @@ class Basic extends Controller
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) {
$this->tokenVerify();
// $this->tokenVerify();
}
}
......
<script src='/resource/lib/js/require.min.js' data-main='/resource/js/main?version=1' charset='utf-8'></script>
\ No newline at end of file
<script src='/resource/lib/js/require.min.js' data-main='/resource/js/main?version=1111122' charset='utf-8'></script>
\ No newline at end of file
......@@ -55,19 +55,21 @@ class AttentionModel extends Model
if (count($res) > 0) {
$saveWhere["id"] = $res[0]["id"];
$arr["is_del"] = 0;
}else{
$arr["create_time"] = date("Y-m-d H:i:s",time());
$arr["update_time"] = date("Y-m-d H:i:s",time());
$id = $res[0]["id"];
} else {
$arr["create_time"] = date("Y-m-d H:i:s", time());
$arr["update_time"] = date("Y-m-d H:i:s", time());
}
}
Db::startTrans();
try {
if(isset($saveWhere["id"])){
$id = $this->save($arr,$saveWhere);
}else{
$id = $this->save($arr);
if (isset($saveWhere["id"])) {
$this->save($arr, $saveWhere);
} else {
$this->save($arr);
$id = $this->id;
}
$id = isset($id) ? $id : $params["id"];
Db::commit();
return [ "code" => "200", "msg" => $id ];
} catch (\Exception $e) {
......
......@@ -79,7 +79,7 @@ class Evaluate extends Model
* @param $userId
* @return false|\PDOStatement|string|\think\Collection
*/
public function getIsEvaluate($source =20 ,$recordId , $userId){
public function getIsEvaluate($source ,$recordId , $userId){
$params["source"] = $source ;
$params["record_id"] = $recordId;
$params["user_id"] = $userId;
......
......@@ -36,7 +36,7 @@ require.config ({
'exports': 'datetimepicker'
},
'pagination' : {
'exports': 'pagination'
'exports': 'jquery'
}
},
'map': {
......@@ -48,4 +48,4 @@ require.config ({
}
});
require (['require', 'jquery', 'doT', 'app/public' ,"datetimepicker",'pagination','bootstrapJs',"paginationStart"]);
require (['require', 'jquery', 'doT', 'app/public' ,"datetimepicker",'pagination','bootstrapJs']);
define (['doT', 'text!temp/transfer_template_tpl.html', 'css!style/home.css'], function (doT, template) {
define (['doT', 'text!temp/transfer_template_tpl.html', 'css!style/home.css','paginationStart'], function (doT, template) {
user = {
pageNo: 1, /*第几页*/
pageSize: 10, /*每页显示多少条*/
......@@ -110,6 +110,8 @@ define (['doT', 'text!temp/transfer_template_tpl.html', 'css!style/home.css'], f
user.getList (el.num.current);
}
});*/
pagination_pages = Math.ceil(data.data.total/user.pageSize);
pagination_totals = data.data.total;
addpage(user.getList);
}
});
......
......@@ -7,7 +7,6 @@ var pagination_totals = 0; //总条数
var pagination_pagesize = 15; //每页显示多少条
function addpage(methodName) {
alert(111111111);
if (pagination_page_no > pagination_pages) pagination_page_no = pagination_pages;
$('.pageinfo').pagination({
pages: pagination_pages, //总页数
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment