wugg há 9 meses atrás
pai
commit
6dd7427e9a

+ 1 - 1
app/bug/controller/Action.php

@@ -27,7 +27,7 @@ class Action extends Base
 	* @return \think\Response|\think\response\Json|void
     */
     public function ActionSave(){
-        $post  =$this->request->param(["id"=>0,"action_name"=>"","action_desc"=>"","status"=>0,"action_code"=>""],
+        $post  =$this->request->param(["id"=>0,"action_name"=>"","action_desc"=>"","status"=>1,"action_code"=>""],
         "post","trim");
         $valid = Validate::rule([
         	"id|主键Id"=>"number|egt:0",

+ 1 - 1
app/bug/controller/Base.php

@@ -6,7 +6,7 @@ namespace app\bug\controller;
 
 use app\bug\model\UserRole;use think\App;
 class Base extends \app\BaseController{
-	protected $noLogin=[];
+	protected $noLogin=["*"];
    protected $uid=0;
    protected $uname='system';
    protected $roleid=1;

+ 0 - 1
app/bug/controller/Cloud.php

@@ -8,7 +8,6 @@ use think\facade\Validate;
 
 class Cloud extends Base
 {
-	protected $noLogin=[];
 	public function __construct(App $app)
 	{
 	    parent::__construct($app);

+ 21 - 21
app/bug/controller/Deal.php

@@ -56,25 +56,25 @@ class Deal extends Base
         }
          return success('添加成功');
     }
-    public function   MenuAllList(){
-        $company_type = isset($this->post['company_type']) && $this->post['company_type']!==""? trim($this->post['company_type']):"";
-        if ($company_type== "") {
-            return error_show(1002,"参数company_type不能为空");
-        }
-        $where=['company_type'=>$company_type,'pid'=>0,'is_del'=>0,"status"=>1];
-        $level = isset($this->post['level']) && $this->post['level']!==""? trim($this->post['level']):"";
-        if ($level== "") {
-            $where['level'] = explode(",",$level);
-        }
-        $data = Db::name("model")->where($where)->order("weight desc")->select();
-        $l=[];
-        foreach ($data as $key=>$value){
-            $temp =  Db::name("model")->where(['pid'=>$value['id'],'is_del'=>0,"level"=>[2,3],"status"=>1])->order("weight desc")
-                ->select()->toArray();
-            $value['child']=$temp;
-            if(empty($temp)) continue;
-            $l[]=$value;
-        }
-        return app_show(0,"获取成功",$l);
-    }
+//    public function   MenuAllList(){
+//        $company_type = isset($this->post['company_type']) && $this->post['company_type']!==""? trim($this->post['company_type']):"";
+//        if ($company_type== "") {
+//            return error_show(1002,"参数company_type不能为空");
+//        }
+//        $where=['company_type'=>$company_type,'pid'=>0,'is_del'=>0,"status"=>1];
+//        $level = isset($this->post['level']) && $this->post['level']!==""? trim($this->post['level']):"";
+//        if ($level== "") {
+//            $where['level'] = explode(",",$level);
+//        }
+//        $data = Db::name("model")->where($where)->order("weight desc")->select();
+//        $l=[];
+//        foreach ($data as $key=>$value){
+//            $temp =  Db::name("model")->where(['pid'=>$value['id'],'is_del'=>0,"level"=>[2,3],"status"=>1])->order("weight desc")
+//                ->select()->toArray();
+//            $value['child']=$temp;
+//            if(empty($temp)) continue;
+//            $l[]=$value;
+//        }
+//        return app_show(0,"获取成功",$l);
+//    }
 }

+ 2 - 2
app/bug/controller/Manange.php

@@ -2,7 +2,7 @@
 
 namespace app\bug\controller;
 
-use app\bug\model\Moudel;use app\user\model\Account;use think\App;
+use app\bug\model\Moudel;use app\bug\model\NoteLog;use app\user\model\Account;use think\App;
 use think\facade\Config;
 use think\facade\Db;use think\facade\Validate;
 
@@ -100,7 +100,7 @@ class Manange extends Base
 	    }
 	    $conf=Config::get('note');
 
-	    $list = Db::name('note_log')->where($where)->order('id desc')->paginate(["list_rows"=>$param['size'],
+	    $list = NoteLog::where($where)->order('id desc')->paginate(["list_rows"=>$param['size'],
 	    "page"=>$param['page']]);
 	    foreach ($list->items() as &$value){
 	        $value['type_cn'] = $value['type']==2?'编辑':'新建';

+ 2 - 2
app/bug/controller/Menu.php

@@ -11,7 +11,7 @@ use think\facade\Validate;
 
 class Menu extends Base
 {
-	protected $noLogin=[];
+	
     public  function __construct(App $app)
     {
         parent::__construct($app);
@@ -22,7 +22,7 @@ class Menu extends Base
     {
         $ACtion = RoleAction::where('role_id','=', $this->roleid)->findOrEmpty();
         if($ACtion->isEmpty())return success('角色无权限!');
-        $data= Db::name("view_menu")->where('aid',"in",$ACtion->action_conllect)->where(['status'=>1,"cstatus"=>1,"is_display"=>1])
+        $data= $this->model->name("view_menu")->where('aid',"in",$ACtion->action_conllect)->where(['status'=>1,"cstatus"=>1,"is_display"=>1])
             ->order("weight desc,id asc,cweight desc,cid asc")->select();
         $list=[];
         $act=[];

+ 2 - 2
app/bug/controller/Model.php

@@ -2,14 +2,14 @@
 
 namespace app\bug\controller;
 
-use think\App;
+use app\bug\model\Moudel;use think\App;
 
 class Model extends Base
 {
 	public function __construct(App $app)
 	{
 	    parent::__construct($app);
-	    $this->model=new \app\bug\model\Model();
+	    $this->model=new Moudel();
 	}
 	public function list(){
 		$param = $this->request->param(["name"=>"","pid"=>"","level"=>"","status"=>"","company_type"=>""],"post","trim");

+ 10 - 8
app/bug/controller/Note.php

@@ -8,7 +8,7 @@ use think\App;use think\facade\Validate;
 
 class Note extends Base
 {
-	protected $noLogin=[];
+//	protected $noLogin=[];
 	public function __construct(App $app)
 	{
 	    parent::__construct($app);
@@ -47,7 +47,8 @@ class Note extends Base
 	public function list(){
 		$param = $this->request->param([
 			'bugNo'=>'','is_created'=>'','company_type'=>'','model_id'=>'','noteNo'=>'','page'=>1,'size'=>10,
-		'apply_name'=>'','weight'=>'','type'=>'','status'=>'','level'=>'',"deal_name"=>"","title"=>""],'post','trim');
+		'apply_name'=>'','type'=>'','status'=>'','start'=>'','end'=>'','level'=>'',"deal_name"=>"","title"=>""],
+		'post','trim');
 	    $where =[['is_del','=',0]];
 	    if($param['bugNo']!=""){
 	        $where[]=['bugNo',"like","%{$param['bugNo']}%"];
@@ -102,7 +103,8 @@ class Note extends Base
 	    }
 	 
 	    if ($param['deal_name']!==""){
-	        $item = Db::name('deal')->where([["deal_name","like","%{$param['deal_name']}%"],["is_del","=",0],['status',"=",0]])->select()
+	        $item = \app\bug\model\Deal::where([["deal_name","like","%{$param['deal_name']}%"],["is_del","=",0],['status',"=",0]])
+	        ->select()
 	        ->toArray();
 	        $cn =array_unique(array_column($item,'bugNo'));
 	        $where[]=["bugNo","in",$cn];
@@ -140,7 +142,7 @@ class Note extends Base
 	    $inf=\app\bug\model\Deal::where(['bugNo'=>$info['bugNo'],'status'=>0,"is_del"=>0])->findOrEmpty();
 	    $oldStatus=$info->status;
 	    $deal = Account::with(["user_info"])->where("id",$param['deal_id'])->findOrEmpty();
-	    \app\bug\model\Note::startTrans();
+	    $this->model->startTrans();
 	    try{
 	    	$info->title= $param['title'];
 	    	$info->noteNo= $param['noteNo'];
@@ -155,7 +157,7 @@ class Note extends Base
 	        if($datainfo){
 	           
 	                    $inf->action_id=$this->uid;
-	                    $inf->action_name=$this->action_name;
+	                    $inf->action_name=$this->uname;
 	                    $inf->deal_id=$param['deal_id'];
 	                    $inf->deal_name=$deal->nickname??"";
 	                    $inf->bugNo=$info->bugNo;
@@ -164,12 +166,12 @@ class Note extends Base
 	                    $inf->status=$oldStatus!=$param['status']?1:0;
 	                    $dc = $inf->save();
 	                    if($dc==false)throw new \Exception("更新失败");
-	                }
+	                }else throw new \Exception('更新失败');
 	        
-			\app\bug\model\Note::commit();
+			$this->model->commit();
 	        return  success("更新成功");
 	    }catch (\Exception $e){
-	        \app\bug\model\Note::rollback();
+	        $this->model->rollback();
 	        return error($e->getMessage());
 	    }
 	}

+ 3 - 1
app/bug/controller/Role.php

@@ -23,9 +23,11 @@ class Role extends Base
      * @throws \think\exception\DbException
      */
     public function  RoleList(){
-        $post  =$this->request->param(["status"=>"","role_name"=>"","createrId"=>"","page"=>1,"size"=>15],"post","trim");
+        $post  =$this->request->param(["status"=>"","role_name"=>"","createrId"=>"","level"=>"","page"=>1,
+        "size"=>15],"post","trim");
         $condition=[];
         isset($post['status'])&&$post['status']!=="" ? $condition[]=['status',"=",$post['status']]:"";
+        isset($post['level'])&&$post['level']!=="" ? $condition[]=['level',"=",$post['level']]:"";
         isset($post['role_name'])&&$post['role_name']!=="" ? $condition[]=['role_name',"like","%".$post['role_name']."%"]:"";
         isset($post['createrId'])&&$post['createrId']!=="" ? $condition[]=["createrId","=",$post['createrId']]:"";
         $list =$this->model->with(["role_action"])->where($condition)->order("id","desc")

+ 4 - 6
app/bug/model/DepartUser.php

@@ -1,7 +1,8 @@
 <?php
 namespace app\bug\model;
 
-use app\user\model\Account;class DepartUser extends Base
+use app\user\model\Account;
+class DepartUser extends Base
 {
 //设置字段信息
     protected $schema = [
@@ -18,12 +19,9 @@ use app\user\model\Account;class DepartUser extends Base
    protected $updateTime='updatetime';
    protected $createTime='addtime';
    
-   public function ItemInfo(){
-   	    return $this->belongsTo(CompanyItem::class,"itemid","id")->bind(["depart_name"=>"name"]);
-   }
    public function GetDepartNameByUid($uid){
-   	    $list=$this->with(["item_info"])->where(["uid"=>$uid])->select();
-   	    return array_column($list->toArray(),"depart_name","uid");
+   	    $list=Account::where(['id'=>$uid])->with(['accountItem'=>['itemName']])->select();
+   	    return array_column($list->toArray(),"depart_name","id");
    }
    //设置角色部门
    public function SetItem($uid,$itemArr=[]){

+ 9 - 9
app/bug/route/app.php

@@ -47,17 +47,17 @@ Route::rule("noteinfo","bug/Note/info");
 Route::rule("notedel","bug/Note/del");
 
 
-Route::rule("modelcreate","bug/Model/create");
+//Route::rule("modelcreate","bug/Model/create");
 Route::rule("modellist","bug/Model/list");
-Route::rule("modelcreate","bug/Model/create");
-Route::rule("modeledit","bug/Model/edit");
-Route::rule("modelinfo","bug/Model/info");
-Route::rule("modeldel","bug/Model/del");
+//Route::rule("modelcreate","bug/Model/create");
+//Route::rule("modeledit","bug/Model/edit");
+//Route::rule("modelinfo","bug/Model/info");
+//Route::rule("modeldel","bug/Model/del");
 
 Route::rule("dealcreate","bug/Deal/create");
 //Route::rule("dealselect","bug/Deal/select");
-Route::rule("deallist","bug/Deal/list");
-Route::rule("dealstatus","bug/Deal/status");
+//Route::rule("deallist","bug/Deal/list");
+//Route::rule("dealstatus","bug/Deal/status");
 
 Route::rule("manangelist","bug/Manange/list");
 Route::rule("manangecreate","bug/Manange/create");
@@ -67,9 +67,9 @@ Route::rule('menuaction', 'bug/Action/ActionList');
 Route::rule('menuactionsave', 'bug/Action/ActionSave');
 Route::rule('menuactionstatus', 'bug/Action/ActionStatus');
 Route::rule('menuactionadd', 'bug/Action/ActionAdd');
-Route::rule("menuactionlist","bug/Action/index");
+//Route::rule("menuactionlist","bug/Action/index");
 Route::rule("menuactiondel","bug/Menu/MenuActionDel");
 
-Route::rule("dealselect","bug/Deal/MenuAllList");
+//Route::rule("dealselect","bug/Deal/MenuAllList");
 Route::rule("dealadd","bug/Deal/add");
 Route::rule("manangeloglist","bug/Manange/loglist");