application/admin/controller/Commont.php

(开头部分) 2KB

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

<?php
namespace app\admin\controller;

use app\admin\model\CommontSpace;
//use app\admin\lib\common\Check;


//use app\admin\lib\lang\Hylang;
//use think\Lang;
class Commont extends Base {

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

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

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

    }

    public function edit_commont_action() {
           $CommontSpace=new CommontSpace;
        $CommontSpace->edit(request()->param('id'));

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

    }

    //删除商品品牌 动作 
    public function del_commont_action($id) {
后面还有 24 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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