Click Load more at the bottom of the article list, even if sharing the code also ask questions
JQ Ajax Code:
ThinkPHP3.2.3 Front Controller index method:
Public Function index () {
$p = $_post[' P '];//3 6 9
$amount = 3; Show number of bars
$count = M ("micro_article")->count ();//Total
$Model = new \think\model ();
$list = $Model->query ("select * from ' day_micro_article ' ORDER by Addtime DESC LIMIT $p, $amount");
$this->ajaxreturn ($list);
}
$count = M ("micro_article")->count ();
$Page = new \think\page ($count, 3);
$show = $Page->show ();
$Model = new \think\model ();
The default display of the latest three article
$list = $Model->query ("select * from ' day_micro_article ' WHERE ' status ' = 1 and ' Is_rec ' = 1 ORDER by ' Addtime ' DES C LIMIT ". $Page->firstrow. ',' . $Page->listrows);
$shouyi = M ("Micro_customlucre")->where (Array ("Zid" =>1))->find ();
$this->assign (' list ', $list);
$this->assign (' Vo1 ', $shouyi);
$this->assign (' show ', $show);
$this->display ();
}
My question: Getlocaltime format timestamp function, take out the time 2015/9/4 7:07 in such a format;
I want 2015/9/4 19:07:22 such a format
------to solve the idea----------------------
function Getlocaltime (NS) {
var d = new Date (parseint (NS) * 1000);
return d.getyear () + '/' + (D.getmonth () +1) + '/' + d.getdate () + ' + d.gethours () + ': ' + d.getminutes () + ': ' + d.gets Econds ();
}
Your $.ajax lacks dataType: ' json ' property, so the returned data is a string.
As a share it's immoral (intentionally hiding the key code)
------to solve the idea----------------------
The data you return is TXT, not json. So the explanation is not.