作者 lyh

gx

... ... @@ -381,22 +381,22 @@ class ImageController extends Controller
foreach ($files as $file){
if(isset($this->cache['image_max']) && ($this->cache['image_max'] != 0)){
if ($file->getSize() > $this->cache['image_max']) {
$this->response('图片最大为500K',Code::SYSTEM_ERROR);
$this->response('图片最大为1024K',Code::SYSTEM_ERROR);
}
}else{
if ($file->getSize() > $max) {
$this->response('图片最大为500K',Code::SYSTEM_ERROR);
$this->response('图片最大为1024K',Code::SYSTEM_ERROR);
}
}
}
}else{
if(isset($this->cache['image_max']) && ($this->cache['image_max'] != 0)){
if ($files->getSize() > $this->cache['image_max']) {
$this->response('图片最大为500K',Code::SYSTEM_ERROR);
$this->response('图片最大为1024K',Code::SYSTEM_ERROR);
}
}else{
if ($files->getSize() > $max) {
$this->response('图片最大为500K',Code::SYSTEM_ERROR);
$this->response('图片最大为1024K',Code::SYSTEM_ERROR);
}
}
}
... ...
... ... @@ -52,8 +52,8 @@ class KeywordLogic extends BaseLogic
* @time :2023/8/23 16:50
*/
public function keywordSave(){
// DB::beginTransaction();
// try {
DB::beginTransaction();
try {
$this->param = $this->handleSaveParam($this->param);
if(isset($this->param['id']) && !empty($this->param['id'])){
$this->model->edit($this->param,['id'=>$this->param['id']]);
... ... @@ -69,11 +69,11 @@ class KeywordLogic extends BaseLogic
$this->model->edit(['route'=>$route],['id'=>$id]);
//清除缓存
Common::del_user_cache('product_keyword',$this->user['project_id']);
// DB::commit();
// }catch (\Exception $e){
// DB::rollBack();
// $this->fail('保存失败');
// }
DB::commit();
}catch (\Exception $e){
DB::rollBack();
$this->fail('保存失败');
}
//通知更新
$this->updateNotify(['project_id'=>$this->user['project_id'], 'type'=>RouteMap::SOURCE_PRODUCT_KEYWORD, 'route'=>$route]);
return $this->success();
... ...