public function goodslists(){
$num = Db::table('shop_lists')->where('status',1)->where('cid',2)->count();
$lists = Db::table('shop_lists')
// ->field(['name','pic','pid','cid'])
->where('status',1)->where('cid',2)->page(1,5)->select()->toArray();
$data = [
'code'=>200,
'message'=>'成功',
'data'=>[
'lists'=>$lists,
//取页数
'total'=>ceil($num/5)
],
];
echo json_encode($data);
}
//加载更多
const loadmore = () => {
console.log(mydata);
mydata.page++;
if (mydata.total >= mydata.page) {
if(mydata.total == mydata.page){
mydata.show = false;
}
goodslists().then((e) => {
mydata.lists = mydata.lists.concat(e.data.data.lists);
});
}
};
相关推荐
© 2020 asciim码
人生就是一场修行