module/flk/source/index/flk_order.ctrl.php
(开头部分) 25KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
class flk_orderControl extends skymvc{
public function __construct(){
parent::__construct();
}
public function onInit(){
M("login")->checkLogin();
}
public function onDefault(){
}
public function onConfirm(){
$userid=M("login")->userid;
$shopid=get("shopid","i");
$shop=MM("flk","flk_shop")->get($shopid,"shopid,shopname,imgurl,flk_discount,flk_maxmoney,flk_new,express_money,send_startprice");
if(empty($shop)){
$this->goAll("请选择商家",1);
}
$cartid=get_post("cartid","i");
$where=" userid=".$userid." AND shopid=".$shopid;
if($cartid){
$where.=" AND id=".$cartid;
}
$cartList=MM("flk","flk_cart")->Dselect(array(
"where"=>$where
));
if(empty($cartList)){
$this->goAll("购物车为空,请先选择商品",1,0,"/");
}
$total_num=0;
$total_money=0;
$goods_money=0;
$express_money=0;
$discount_money=0;
$coupon_money=0;
$coupon_id=0;
$weight=0;
if($cartList){
foreach($cartList as $v){
$total_num+=$v["amount"];
$goods_money+=$v["amount"]*$v["price"];
$weight+=$v["amount"]*$v["weight"];
if($v["amount"]>$v["total_num"]){
$this->goAll($v["title"]."当前库存只剩下".$v["total_num"].",库存不足,请减少购买数量或者取消",1);
}
}
}
$total_money=$goods_money;
if($total_money<$shop["send_startprice"]){
$this->goAll("未达到起送价".$shop["send_startprice"]."元",1);
}
//优惠券
$coupon_id=0;
$couponList=MM("flk","flk_coupon")->UseList($shopid,$userid,$total_money);
if($couponList){
$coupon_id=$couponList[0]["id"];
}
后面还有 874 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。