module/flk/source/index/flk_prolist.ctrl.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
class flk_prolistControl extends skymvc{
public function __construct(){
parent::__construct();
}
public function onDefault(){
$where=" status in(0,1,2)";
$url="/module.php?m=flk_product&a=default";
$limit=20;
$start=get("per_page","i");
$catid=get("catid","i");
if($catid){
$cids=MM("flk","flk_category")->id_family($catid);
$where.=" AND catid in("._implode($cids).") ";
}else{
$where.=" AND isrecommend=1 ";
}
$option=array(
"start"=>$start,
"limit"=>$limit,
"order"=>" id DESC",
"where"=>$where
);
$rscount=true;
$data=M("mod_flk_product")->select($option,$rscount);
//分类
$catList=MM("flk","flk_category")->children(0);
//判断产品是否在购物车
$userid=M("login")->userid;
$cartPros=MM("flk","flk_cart")->getProductAmount("userid=".$userid." AND ksid=0");
if($data){
foreach($data as $k=>$v){
$v["incart"]=0;
$v["cart_amount"]=0;
$v["imgurl"]=images_site($v["imgurl"]);
if($cartPros && isset($cartPros[$v["id"]])){
$v["incart"]=1;
$v["cart_amount"]=$cartPros[$v['id']];
}
$data[$k]=$v;
}
}
$per_page=$start+$limit;
$per_page=$per_page>$rscount?0:$per_page;
$pagelist=$this->pagelist($rscount,$limit,$url);
$this->smarty->goassign(
array(
"list"=>$data,
"per_page"=>$per_page,
"pagelist"=>$pagelist,
"catList"=>$catList,
"rscount"=>$rscount,
"url"=>$url
)
);
$this->smarty->display("flk_prolist/index.html");
}
后面还有 1 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。