AiCommandLogic.php
2.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
<?php
namespace App\Http\Logic\Aside\Ai;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Ai\AiCommand as AiCommandModel;
class AiCommandLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new AiCommandModel();
$this->param = $this->requestAll;
}
/**
* @name :详情
* @return void
* @author :liyuhang
* @method
*/
<<<<<<< HEAD
public function info(){
=======
public function ai_info(){
<<<<<<< HEAD
>>>>>>> 0a33166a03a36ebcf1c74fe78d1a9a2080e1c6d4
=======
$info = $this->model->read($this->param);
if($info !== false){
$this->fail('当前数据不存在');
}
>>>>>>> 6732faf6504ff84e7d22309bfc7c7de49f0432c0
return $this->success();
}
/**
* @name :添加指令
* @return void
* @author :liyuhang
* @method
*/
<<<<<<< HEAD
public function add(){
=======
public function ai_add(){
<<<<<<< HEAD
>>>>>>> 0a33166a03a36ebcf1c74fe78d1a9a2080e1c6d4
=======
$condition = [
'key'=>$this->param['key']
];
$info = $this->model->read($condition);
if($info !== false){
$this->fail('当前指令已存在');
}
$rs = $this->model->add($this->param);
if($rs === false){
$this->fail('error');
}
>>>>>>> 6732faf6504ff84e7d22309bfc7c7de49f0432c0
return $this->success();
}
/**
* @name :编辑站内信
* @return void
* @author :liyuhang
* @method
*/
<<<<<<< HEAD
public function edit(){
=======
public function ai_edit(){
<<<<<<< HEAD
>>>>>>> 0a33166a03a36ebcf1c74fe78d1a9a2080e1c6d4
=======
$condition = [
'id'=>['!=',$this->param['id']],
'key'=>$this->param['key']
];
$info = $this->model->read($condition);
if($info !== false){
$this->fail('当前编辑的已存在');
}
$rs = $this->model->edit($this->param,['id'=>$this->param['id']]);
if($rs === false){
$this->fail('error');
}
>>>>>>> 6732faf6504ff84e7d22309bfc7c7de49f0432c0
return $this->success();
}
/**
* @name :删除站内信
* @return void
* @author :liyuhang
* @method
*/
<<<<<<< HEAD
public function del(){
=======
public function ai_del(){
<<<<<<< HEAD
>>>>>>> 0a33166a03a36ebcf1c74fe78d1a9a2080e1c6d4
=======
$this->param['id'] = ['in',$this->param['id']];
$rs = $this->model->del($this->param);
if($rs === false){
$this->fail('error');
}
>>>>>>> 6732faf6504ff84e7d22309bfc7c7de49f0432c0
return $this->success();
}
}