application/index/controller/UserWebMessage.php

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

<?php

namespace app\index\controller;

//use think\Controller;
use app\index\model\CartSpace;

class UserCart extends UserBase {

    public function index() {
        $buy_or_cart= session("buy_or_cart","", "index");
        if(!$buy_or_cart){$buy_or_cart=2;}
//        dump($buy_or_cart);
        $CartSpace_old = CartSpace::where(['buy_uid'=> session('uid','', 'index'),'buy_or_cart'=> $buy_or_cart])->order('update_time', 'desc')->select();

//        $CartSpace_old = CartSpace::where('buy_uid', session('uid', '', 'index'))->order('update_time', 'desc')->select();
//         if ($CartSpace['pic']) { $arr_pic = explode(",", $CartSpace['pic']);}
          foreach ($CartSpace_old as $value) {
           $value['arr_pic']=explode(",", $value['pic']);
           $CartSpace[]= $value;
        }
        $this->assign('buy_or_cart', $buy_or_cart);
        $this->assign('CartSpace', $CartSpace);
        return $this->fetch();
    }
    
     //删除商品 动作 
    public function del_goods_action() {
        //检查当前删除购物商品的人是否是之前商品购买者 防止外部代码删除 
        if(session('uid','', 'index')==request()->param('value')){
        $res=CartSpace::where('id', request()->param('id'))->delete();
       return $this->json_data($res);
        }
    }

    public function add_cart_form() {
//           $cate=cart_type_tree();
//          dump($cate);die;
        $brand = db('cart_brand_space')->order('id', 'asc')->select();

        $this->assign('brand', $brand);
        return $this->fetch();
    }

    public function edit_cart_form() {
        $CartSpace = CartSpace::get(['id' => request()->param('id')]);
        if ($CartSpace['pic']) { $arr_pic = explode(",", $CartSpace['pic']);}
        if ($CartSpace['color']) { $arr_color = explode(",", $CartSpace['color']);}
        if ($CartSpace['model']) {$arr_model = explode(",", $CartSpace['model']); }
        $cate2 = db('cart_type_space')->where('pid', $CartSpace['cart_type'])->order('id', 'asc')->select();
        $cate3 = db('cart_type_space')->where('pid', $CartSpace['cart_type2'])->order('id', 'asc')->select();

        $brand = db('cart_brand_space')->order('id', 'asc')->select();
//        dump($arr_color);
        $this->assign('cate2', $cate2);
         $this->assign('cate3', $cate3);
        $this->assign('arr_color', $arr_color);
        $this->assign('arr_model', $arr_model);
        $this->assign('brand', $brand);
        $this->assign('CartSpace', $CartSpace);
后面还有 69 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。