国产av日韩一区二区三区精品,成人性爱视频在线观看,国产,欧美,日韩,一区,www.成色av久久成人,2222eeee成人天堂

小型企業(yè)站分類模塊

Original 2019-06-16 10:08:09 326
abstract:<?phpnamespace app\admin\controller;use think\Controller;use app\admin\model\User;use app\admin\model\Sort;use think\facade\Session;use think\facade\Request;use app\admin\controller\Commn;class Sor

<?php

namespace app\admin\controller;

use think\Controller;

use app\admin\model\User;

use app\admin\model\Sort;

use think\facade\Session;

use think\facade\Request;

use app\admin\controller\Commn;


class Sortl extends Commn

{

public function index()

{

$res = Sort::order('sort_id','desc')->paginate(4);


$page = $res->render();


$this->assign('res',$res);


$this->assign('page',$page);


return $this->fetch();

}

public function index_do()

{

$data = Request::param();


$data['username'] = Session::get('username');


$data['sort_create_time'] = time();


$sort_name = $data['sort_name'];


if ($res = Sort::where('sort_name',$sort_name)->find()) {

return json(['code'=>1,'msg'=>'不可以添加重復分類']);

}

if ($sort = Sort::insert($data)) {

return json(['code'=>2,'msg'=>'添加分類成功']);

}else{

return json(['code'=>3,'msg'=>'添加分類失敗']);

}

}

public function upl()

{

$data = Request::param();


$sort_id = $data['id'];


$res = Sort::where('sort_id',$sort_id)->find();


$this->assign('res',$res);


return $this->fetch();

}

public function upl_do()

{

$data = Request::param();

//驗證唯一

$sort_id = $data['sort_id'];

//查詢

// $res = Sort::where('sort_id',$sort_id)->find();


// if ($res['sort_name'] == $data['sort_name']) {

// if ($res = Sort::where('sort_id',$sort_id)->update($data)) {

// return json(['code'=>1,'msg'=>'修改分類成功']);

// }else{

// return json(['code'=>2,'msg'=>'修改操作錯誤,請重新修改']);

// }

// }

if ($Sort = Sort::where('sort_id',$sort_id)->update($data)) {

return json(['code'=>1,'msg'=>'修改分類成功']);

}else{

return json(['code'=>2,'msg'=>'修改操作錯誤,請重新修改']);

}

}

public function del()

{

$data = Request::param();


$sort_id = $data['id'];


if ($res = Sort::where('sort_id',$sort_id)->delete()) {

return json(['code'=>1,'msg'=>'刪除分類成功']);

}else{

return json(['code'=>2,'msg'=>'刪除分類失敗']);

}


}

}

HO~XI$@6DO41I7MYZG58LTB.png

Correcting teacher:查無此人Correction time:2019-06-17 09:31:55
Teacher's summary:完成的不錯。一天做了很多作業(yè),對后臺管理應該很熟悉了。繼續(xù)加油。

Release Notes

Popular Entries