application/admin/controller/Shop.php

(开头部分) 2KB

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

<?php
namespace app\admin\controller;

use app\admin\model\ShopSpace;

class Shop extends Base {

    //商品品牌列表
    public function index() {
        $shoplist = ShopSpace::all();
        foreach ($shoplist as $value) {
           $value['arr_pic']=explode(",", $value['pic']);
           $shoplist_new[]= $value;
        }
       // dump($shoplist_new);
        $this->assign('shoplist', $shoplist_new);
        return $this->fetch();
    }

    //添加商品品牌 页面
    public function add_shop() {
        return $this->fetch();
    }
    //编辑商品品牌 页面
    public function edit_shop($id) {
        $ShopSpace = ShopSpace::get(['id' => $id]);
       if($ShopSpace['pic']){
          $arr_pic=explode(",", $ShopSpace['pic']);
       } 
        $this->assign('ShopSpace', $ShopSpace);
        $this->assign('arr_pic', $arr_pic);
        $this->assign('shop_id', $id);
//        $AuthGroup = AuthGroup::all();
//        $this->assign('AuthGroup', $AuthGroup);
        return $this->fetch();
    }

    //添加或修改商品品牌动作
    public function add_shop_action() {
         $ShopSpace=new ShopSpace;
         $ShopSpace->add();
         
         $this->redirect('Shop/index');

    }

    public function edit_shop_action() {
           $ShopSpace=new ShopSpace;
        $ShopSpace->edit();

            $this->redirect('Shop/index');

    }

    //删除商品品牌 动作 
    public function del_shop_action($id) {
        $res=ShopSpace::where('id', '=', $id)->delete();
       return $this->json_data($res);
    }
    
后面还有 20 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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