feat:添加前台获取客户代码块列表接口
This commit is contained in:
parent
6acc90760c
commit
3f81d7fce8
@ -22,6 +22,51 @@ use app\common\logic\CustomerMessage\Audit\CodeModule as CustomerMessageAuditCod
|
||||
|
||||
class CodeModule extends BaseController
|
||||
{
|
||||
/**
|
||||
* 获取客户代码块接口
|
||||
*
|
||||
* @param Request $request
|
||||
* @return array
|
||||
* @date 2023-08-18
|
||||
* @author xjh
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public function getCodeModuleList(Request $request): array
|
||||
{
|
||||
$params = $request->param();
|
||||
$this->validate($params, [
|
||||
'customer_guid|客户guid' => 'require',
|
||||
]);
|
||||
|
||||
$con = Tool::getOptionalQuery(
|
||||
['a.code_module_category_guid'],
|
||||
['code_module_name', 'LIKE'],
|
||||
['code_module_audit', '='],
|
||||
['a.customer_guid', '=', 'customer_guid'],
|
||||
);
|
||||
|
||||
$query = ModelCodeModule::where($con)
|
||||
->alias('a')
|
||||
->leftjoin('code_module_category c', 'a.code_module_category_guid = c.code_module_category_guid')
|
||||
->field([
|
||||
'a.code_module_id',
|
||||
'a.code_module_guid',
|
||||
'c.code_module_category_name',
|
||||
'a.code_module_category_guid',
|
||||
'a.code_module_name',
|
||||
'a.code_module_html',
|
||||
'a.code_module_style',
|
||||
'a.code_module_script',
|
||||
'a.code_module_sort',
|
||||
'a.code_module_audit',
|
||||
'a.customer_guid'
|
||||
])
|
||||
->order('code_module_sort', 'asc');
|
||||
|
||||
return msg("获取代码块列表成功!", $query);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加代码块接口
|
||||
*
|
||||
|
Loading…
Reference in New Issue
Block a user