application/index/controller/UserCheckout.php

(开头部分) 17KB

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

<?php

namespace app\index\controller;

use app\index\model\UserOrderSpace;
use app\index\model\MoneySpace;
use app\index\model\UserSpace;
use app\index\model\AddressSpace;
use app\index\model\CartSpace;
use app\index\model\GoodsSpace;
use app\index\model\FreightCaseSpace;
use app\index\model\FreightDetailSpace;
use app\index\model\RegionSpace;

class UserCheckout extends UserBase {

    public function index() {
       
          //设置立购物模式为购物车模式,免得打开购物车出现的是立即购买模式
          session("buy_or_cart",2, "index");
        $UserSpace = UserSpace::where('uid', session('uid', '', 'index'))->find();
        $AddressSpace = AddressSpace::where('uid', session('uid', '', 'index'))->order('id', 'asc')->select();
//        默认地址
        $df_address = AddressSpace::where(['uid' => session('uid', '', 'index'), 'is_default' => 1])->find();
      //默认运费总价
        if($df_address){
           $postage_arr= $this->get_postage_arr($df_address['id']);
            $df_postage_total=array_sum($postage_arr);
             session("postage_arr",$postage_arr, "index");
//        $df_postage_total=$this->get_postage_arr($df_address['id']);
        }else{
            $df_postage_total=0;
        }
        $checkout_ids = session("checkout_ids", "", "index");
        $RegionSpace = db('region_space')->where('ParentId', 1)->order('PkId', 'asc')->select();
        
//          $WebAccountSpace_bank = db('money_web_account_space')->where('web_account_type', 2)->order('id', 'asc')->select();
        // 根据主键获取多个数据 正好check_ids是逗号隔断的字符串
        //list = User::all('1,2,3');
       
        if ($checkout_ids) {
            $CartSpace_old = CartSpace::all($checkout_ids);
            foreach ($CartSpace_old as $value) {
                $value['arr_pic'] = explode(",", $value['pic']);
                $CartSpace[] = $value;
            }
        }
        //银行账户 开始
         $WebAccountSpace_old = db('money_web_account_space')->order('id', 'asc')->select();
         foreach ($WebAccountSpace_old as $value) {
                $value['arr_pic'] = explode(",", $value['pic']);
               $WebAccountSpace[] = $value;
            }
        $this->assign('WebAccountSpace', $WebAccountSpace);
         //银行账户 结束
        
         //删除admin_test_alipay,防止进入管理员测试支付模式
            session('admin_test_alipay', null, 'index'); 
         //是否打开支付宝 开始
        $open_alipay_space=db('money_config_space')->where('config_name','open_alipay')->find();
后面还有 319 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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