|
@@ -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());
|
|
|
}
|
|
|
}
|