|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Aside;
|
|
|
|
|
|
|
|
use App\Enums\Common\Code;
|
|
|
|
use App\Http\Logic\Aside\Service\ServiceLogic;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :企业服务设置信息
|
|
|
|
* @name :ServiceController
|
|
|
|
* @author :lyh
|
|
|
|
* @time :2023/6/25 16:13
|
|
|
|
*/
|
|
|
|
class ServiceController extends BaseController
|
|
|
|
{
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :列表
|
|
|
|
* @name :lists
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/25 14:31
|
|
|
|
*/
|
|
|
|
public function lists(ServiceLogic $serviceLogic){
|
|
|
|
$lists = $serviceLogic->serviceLists($this->map,$this->page,$this->row,$this->order);
|
|
|
|
$this->response('success',Code::SUCCESS,$lists);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :企业服务通知详情
|
|
|
|
* @name :read
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/25 11:50
|
|
|
|
*/
|
|
|
|
public function read(ServiceLogic $serviceLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'id' => 'required',
|
|
|
|
],[
|
|
|
|
'id.required' => '主键不能为空',
|
|
|
|
]);
|
|
|
|
$info = $serviceLogic->serviceRead();
|
|
|
|
$this->response('success',Code::SUCCESS,$info);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :新增或编辑
|
|
|
|
* @name :save
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/25 11:51
|
|
|
|
*/
|
|
|
|
public function save(ServiceLogic $serviceLogic){
|
|
|
|
if(isset($this->param['id'])){
|
|
|
|
$this->request->validate([
|
|
|
|
'id' => 'required',
|
|
|
|
],[
|
|
|
|
'id.required' => '主键不能为空',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
//参数验证
|
|
|
|
$this->verifyParam();
|
|
|
|
$serviceLogic->serviceSave();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :编辑指定状态
|
|
|
|
* @name :status
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/25 14:15
|
|
|
|
*/
|
|
|
|
public function status(ServiceLogic $serviceLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'id' => 'required',
|
|
|
|
],[
|
|
|
|
'id.required' => '主键不能为空',
|
|
|
|
]);
|
|
|
|
$serviceLogic->serviceStatus();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param ServiceLogic $serviceLogic
|
|
|
|
* @remark :删除信息
|
|
|
|
* @name :del
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/25 14:26
|
|
|
|
*/
|
|
|
|
public function del(ServiceLogic $serviceLogic){
|
|
|
|
$this->request->validate([
|
|
|
|
'id' => 'required|array',
|
|
|
|
],[
|
|
|
|
'id.required' => '主键不能为空',
|
|
|
|
]);
|
|
|
|
$serviceLogic->serviceDel();
|
|
|
|
$this->response('success');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @remark :参数验证
|
|
|
|
* @name :validParam
|
|
|
|
* @author :lyh
|
|
|
|
* @method :post
|
|
|
|
* @time :2023/6/25 14:03
|
|
|
|
*/
|
|
|
|
public function verifyParam(){
|
|
|
|
$this->request->validate([
|
|
|
|
'address' => 'required',
|
|
|
|
'duty_phone' => 'required',
|
|
|
|
'landline_telephone' => 'required',
|
|
|
|
'free_hotline' => 'required',
|
|
|
|
'enterprise_qq' => 'required',
|
|
|
|
'android' => 'required',
|
|
|
|
'official_account' => 'required',
|
|
|
|
'ios' => 'required',
|
|
|
|
'image' => 'required',
|
|
|
|
'app_remark' => 'required',
|
|
|
|
],[
|
|
|
|
'address.required' => '地址不能为空',
|
|
|
|
'duty_phone.required' => '值班电话不能为空',
|
|
|
|
'landline_telephone.required' => '座机电话不能为空',
|
|
|
|
'free_hotline.required' => '免费热线不能为空',
|
|
|
|
'enterprise_qq.required' => '企业qq不能为空',
|
|
|
|
'android.required' => '安卓不能为空',
|
|
|
|
'official_account.required' => '公众号不能为空',
|
|
|
|
'ios.required' => 'ios下载地址不能为空',
|
|
|
|
'image.required' => '轮播图不能为空',
|
|
|
|
'app_remark.required' => 'app下载备注信息不能为空',
|
|
|
|
]);
|
|
|
|
}
|
|
|
|
} |
...
|
...
|
|