Pengubahsuaian ...LOGIN

Pengubahsuaian klasifikasi produk

Pengubahsuaian kategori produk

Prinsip pengubahsuaian kategori produk adalah sama seperti ahli.

CateController.class.php

  public function edit(){
        $cate=D('cate');
        if (IS_POST) {
            if($cate->create()){
                if ($cate->save()!== false) {
                    $this->success('修改商品分类成功',U('index'));
                }else{
                    $this->error('修改商品分类失败!');
                }
            }else{
                $this->error($cate->getError());
            }
            return;
        }
        $cates=$cate->find(I('id'));
        $cateres=$cate->catetree();
        $this->assign('cateres',$cateres);
        $this->assign('cates',$cates);
        $this->display();
    }

Selepas menerima parameter, sahkannya.

$cates=$cate->find(I('id'));
$cateres=$cate->catetree();
$this->assign('cateres',$cateres);

Dapatkan id yang dihantar dan kemudian hasilkan pepohon klasifikasi. .bahagian seterusnya

public function edit(){ $cate=D('cate'); if (IS_POST) { if($cate->create()){ if ($cate->save()!== false) { $this->success('修改商品分类成功',U('Cate/index')); }else{ $this->error('修改商品分类失败!'); } }else{ $this->error($cate->getError()); } return; } $cates=$cate->find(I('id')); $cateres=$cate->catetree(); $this->assign('cateres',$cateres); $this->assign('cates',$cates); $this->display(); }
babperisian kursus