ServiceLogic.php
1.6 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
<?php
namespace App\Http\Logic\Aside\Service;
use App\Http\Logic\Aside\BaseLogic;
use App\Models\Service;
use Illuminate\Support\Facades\DB;
class ServiceLogic extends BaseLogic
{
public function __construct()
{
parent::__construct();
$this->model = new Service();
$this->param = $this->requestAll;
}
/**
* @remark :企业服务列表
* @name :serviceLists
* @author :lyh
* @method :post
* @time :2023/6/25 14:32
*/
public function serviceLists($map){
$map['type'] = 1;
$lists = $this->model->list($map);
foreach ($lists as $k => $v){
switch ($v['key']){
case 'images':
$arr = explode(',',$v['values']);
foreach ($arr as $k1 => $v1){
$v['images_link'][$k1] = url('a/image/'.$v1);
}
break;
case 'android':
$v['android_link'] = url('a/image/'.$v['values']);
break;
case 'ios':
$v['ios_link'] = url('a/image/'.$v['values']);
break;
}
$lists[$k] = $v;
}
return $this->success($lists);
}
/**
* @remark :新增或编辑
* @name :serviceSave
* @author :lyh
* @method :post
* @time :2023/6/25 13:45
*/
public function serviceSave(){
$rs = $this->model->insert($this->param['data']);
if($rs === false){
$this->fail('批量插入失败');
}
return $this->success();
}
}