where('status',$searchInfo['status']); } if(isset($searchInfo['info'])){ $ssInfo='%'.$searchInfo['info'].'%'; $list=$list ->where(function($query) use ($ssInfo) { $query->where('app_name', 'like', $ssInfo) ->orWhere('app_id', 'like',$ssInfo); }); } $list=$list->where('is_del',0)->orderBy('id','desc')->get(); return \Yz::Return(true,'',$list); } public function Save() { $info=request('info'); $do=false; if($info['id']==0){ $change=DB::table('y_app')->where(['app_id'=>$info['app_id']])->first(); if(!!$change) return \Yz::echoError1('app_id已存在'); $do= DB::table('y_app')->insert($info); }else{ $do= DB::table('y_app')->where(['id'=>$info['id']])->update($info); } if($do){ return \Yz::Return(true,'',[]); }else{ return \Yz::echoError1("操作失败"); } } public function Del() { $id=request('id'); $d=DB::table('y_app')->where(['id'=>$id])->update([ 'is_del'=>1 ]); if($d){ return \Yz::Return(true,'操作成功',[]); }else{ return \Yz::Return(false,'删除失败',[]); } } }