|
@@ -41,6 +41,27 @@ class AyrShareLogic extends BaseLogic |
|
@@ -41,6 +41,27 @@ class AyrShareLogic extends BaseLogic |
|
41
|
}
|
41
|
}
|
|
42
|
|
42
|
|
|
43
|
/**
|
43
|
/**
|
|
|
|
44
|
+ * @name :AyrVerify(验证参数)
|
|
|
|
45
|
+ * @author :lyh
|
|
|
|
46
|
+ * @method :post
|
|
|
|
47
|
+ * @time :2023/6/7 11:52
|
|
|
|
48
|
+ */
|
|
|
|
49
|
+ public function AyrVerify(){
|
|
|
|
50
|
+ if(isset($this->param['id'])){
|
|
|
|
51
|
+ $info = $this->model->read(['name'=>$this->param['name'],'id'=>['!=',$this->param['id']]]);
|
|
|
|
52
|
+ if($info !== false){
|
|
|
|
53
|
+ $this->fail('当前名称已存在');
|
|
|
|
54
|
+ }
|
|
|
|
55
|
+ }else{
|
|
|
|
56
|
+ $count = $this->model->where(['project_id'=>$this->user['project_id']])->count();
|
|
|
|
57
|
+ if($count > $this->model::COUNT){
|
|
|
|
58
|
+ $this->fail('当前账户只允许添加3个账号');
|
|
|
|
59
|
+ }
|
|
|
|
60
|
+ }
|
|
|
|
61
|
+ return $this->success();
|
|
|
|
62
|
+ }
|
|
|
|
63
|
+
|
|
|
|
64
|
+ /**
|
|
44
|
* @name :(创建账号并绑定写入数据库)ayr_add
|
65
|
* @name :(创建账号并绑定写入数据库)ayr_add
|
|
45
|
* @author :lyh
|
66
|
* @author :lyh
|
|
46
|
* @method :post
|
67
|
* @method :post
|
|
@@ -56,9 +77,8 @@ class AyrShareLogic extends BaseLogic |
|
@@ -56,9 +77,8 @@ class AyrShareLogic extends BaseLogic |
|
56
|
'project_id'=>$this->user['project_id'],
|
77
|
'project_id'=>$this->user['project_id'],
|
|
57
|
'name'=>$this->param['name'],
|
78
|
'name'=>$this->param['name'],
|
|
58
|
];
|
79
|
];
|
|
59
|
- $info = $this->model->read(['name'=>$this->param['name']]);
|
|
|
|
60
|
- if($info !== false){
|
|
|
|
61
|
- $rs = $this->model->edit($param,['id'=>$info['id']]);
|
80
|
+ if(isset($this->param['id'])){
|
|
|
|
81
|
+ $rs = $this->model->edit($param,['id'=>$this->param['id']]);
|
|
62
|
}else{
|
82
|
}else{
|
|
63
|
$rs = $this->model->add($param);
|
83
|
$rs = $this->model->add($param);
|
|
64
|
}
|
84
|
}
|
|
@@ -112,36 +132,6 @@ class AyrShareLogic extends BaseLogic |
|
@@ -112,36 +132,6 @@ class AyrShareLogic extends BaseLogic |
|
112
|
return $this->success();
|
132
|
return $this->success();
|
|
113
|
}
|
133
|
}
|
|
114
|
/**
|
134
|
/**
|
|
115
|
- * @name :(根据hash获取图片详情)save_info_info
|
|
|
|
116
|
- * @author :lyh
|
|
|
|
117
|
- * @method :post
|
|
|
|
118
|
- * @time :2023/5/10 15:01
|
|
|
|
119
|
- */
|
|
|
|
120
|
- public function save_img_info($hash){
|
|
|
|
121
|
- $imageModel = new ImageModel();
|
|
|
|
122
|
- $info = $imageModel->read(['hash'=>$hash]);
|
|
|
|
123
|
- if($info === false){
|
|
|
|
124
|
- $this->fail('error');
|
|
|
|
125
|
- }
|
|
|
|
126
|
- return $this->success($info);
|
|
|
|
127
|
- }
|
|
|
|
128
|
-
|
|
|
|
129
|
- /**
|
|
|
|
130
|
- * @name :(根据hash视频详情)save_info_info
|
|
|
|
131
|
- * @author :lyh
|
|
|
|
132
|
- * @method :post
|
|
|
|
133
|
- * @time :2023/5/10 15:01
|
|
|
|
134
|
- */
|
|
|
|
135
|
- public function save_file_info($hash){
|
|
|
|
136
|
- $fileModel = new FileModel();
|
|
|
|
137
|
- $info = $fileModel->read(['hash'=>$hash]);
|
|
|
|
138
|
- if($info === false){
|
|
|
|
139
|
- $this->fail('error');
|
|
|
|
140
|
- }
|
|
|
|
141
|
- return $this->success($info);
|
|
|
|
142
|
- }
|
|
|
|
143
|
-
|
|
|
|
144
|
- /**
|
|
|
|
145
|
* @name :(更新图片库)save_img
|
135
|
* @name :(更新图片库)save_img
|
|
146
|
* @author :lyh
|
136
|
* @author :lyh
|
|
147
|
* @method :post
|
137
|
* @method :post
|