ManageLogic.php
1.1 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
<?php
namespace App\Http\Logic\Aside\Manage;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Manage\Manage;
use Illuminate\Support\Facades\Hash;
/**
* Class ManageLogic
* @package App\Http\Logic\Aside\Manage
* @author zbj
* @date 2023/4/20
*/
class ManageLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->param = $this->requestAll;
$this->model = new Manage();
}
public function save($param){
if(!empty($param['password'])){
$param['password'] = Hash::make($param['password']);
}
return parent::save($param);
}
public function getCacheName($id){
$info = $this->model->read(['id'=>$id]);
return $info['name'] ?? '';
}
/**
* @remark :设置排序
* @name :setSort
* @author :lyh
* @method :post
* @time :2023/8/10 16:42
*/
public function setParamStatus(){
$rs = $this->model->edit(['sort'=>$this->param['sort']],['id'=>$this->param['id']]);
if($rs === false){
$this->fail('修改失败');
}
return $this->success();
}
}