This commit is contained in:
2025-03-25 16:13:53 +08:00
parent 3b40995173
commit 517709254a
10 changed files with 56 additions and 18 deletions

View File

@@ -3,6 +3,7 @@
namespace app\admin\controller;
use app\common\controller\Backend;
use think\Db;
/**
* 合作企业
@@ -11,7 +12,7 @@ use app\common\controller\Backend;
*/
class Firm extends Backend
{
protected $noNeedRight = ['index'];
protected $noNeedRight = ['index','getAiService'];
/**
* Firm模型对象
@@ -35,4 +36,16 @@ class Firm extends Backend
*/
//查询企业的AI客服
function getAiService(){
//查询当前企业已经配置的AI客服
$aicustomerservice_ids = Db::table('fa_firm')
->where('id',session_admin_firm_id())
->value('aicustomerservice_ids');
$info = Db::table('fa_aicustomerservice')
->whereIn('id',explode(',',$aicustomerservice_ids))
->select();
return json(['list'=>$info,'total'=>$info]);
}
}

View File

@@ -28,8 +28,6 @@ class Firmcustomer extends Backend
parent::_initialize();
$this->model = new \app\admin\model\Firmcustomer;
$this->view->assign("statusList", $this->model->getStatusList());
$this->model->where('firmcustomer.firm_id',session_admin_firm_id());
$this->model->where('firmcustomer.firmstore_id',session_admin_firmstore_id());
}
@@ -57,6 +55,8 @@ class Firmcustomer extends Backend
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$this->model->where('firmcustomer.firm_id',session_admin_firm_id());
$this->model->where('firmcustomer.firmstore_id',session_admin_firmstore_id());
$list = $this->model
->with(['firmstoreprojectstwo','firmcustomerorigin'])
->where($where)

View File

@@ -28,6 +28,7 @@ class Admin extends Backend
protected $searchFields = 'id,username,nickname';
protected $childrenGroupIds = [];
protected $childrenAdminIds = [];
protected $noNeedRight = ['index'];
public function _initialize()
{

View File

@@ -1,11 +1,10 @@
<?php
return [
'Id' => 'ID',
'Name' => '企业简称',
'Full_name' => '企业名称',
'Address' => '地址',
'Phone' => '电话',
'Person' => '联系人',
'Create_time' => '创建时间'
'Id' => 'ID',
'Name' => '企业简称',
'Full_name' => '企业名称',
'Address' => '地址',
'Aicustomerservice_ids' => 'AI客服可多选',
'Create_time' => '创建时间'
];

View File

@@ -51,7 +51,7 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('角色')}:</label>
<label class="control-label col-xs-12 col-sm-2">{:__('角色')}(必须):</label>
<div class="col-xs-12 col-sm-8">
{:build_radios('row[role]', ['admin'=>'系统管理员', 'firm'=>'企业管理员'],$row.role)}
</div>
@@ -79,7 +79,7 @@
<div class="col-xs-12 col-sm-8">
<input id="c-firmduty_id" min="0" data-rule="required"
data-source="firmduty/index" class="form-control selectpage"
name="row[firmduty_id]" type="text" value="">
name="row[firmduty_id]" type="text" value="{$row.firmduty_id}">
</div>
</div>
<!-- <div class="form-group">-->

View File

@@ -18,7 +18,12 @@
<input id="c-address" class="form-control" name="row[address]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Aicustomerservice_ids')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-aicustomerservice_ids" data-rule="required" data-source="aicustomerservice/index" data-multiple="true" class="form-control selectpage" name="row[aicustomerservice_ids]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
<div class="col-xs-12 col-sm-8">

View File

@@ -18,7 +18,12 @@
<input id="c-address" class="form-control" name="row[address]" type="text" value="{$row.address|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Aicustomerservice_ids')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-aicustomerservice_ids" data-rule="required" data-source="aicustomerservice/index" data-multiple="true" class="form-control selectpage" name="row[aicustomerservice_ids]" type="text" value="{$row.aicustomerservice_ids|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Create_time')}:</label>
<div class="col-xs-12 col-sm-8">

View File

@@ -18,6 +18,13 @@
<input id="c-phone" class="form-control" name="row[phone]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('AI客服')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-aicustomerservice_ids" data-source="firm/getAiService"
class="form-control selectpage" name="row[aicustomerservice_ids]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Rel_wx')}:</label>
<div class="col-xs-12 col-sm-6">
@@ -74,11 +81,11 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Firmemployee_id')}:</label>
<label class="control-label col-xs-12 col-sm-2">责任人:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-firmemployee_id" data-rule="required" data-source="auth/admin/index"
data-field="nickname"
class="form-control selectpage" name="row[firmemployee_id]" type="text" value="">
class="form-control selectpage" name="row[admin_id]" type="text" value="">
</div>
</div>
<div class="form-group">

View File

@@ -18,6 +18,13 @@
<input id="c-phone" class="form-control" name="row[phone]" type="text" value="{$row.phone|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('AI客服')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-aicustomerservice_ids" data-source="firm/getAiService"
class="form-control selectpage" name="row[aicustomerservice_ids]" type="text" value="{$row.aicustomerservice_ids|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Rel_wx')}:</label>
<div class="col-xs-12 col-sm-8">
@@ -64,12 +71,12 @@
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Firmemployee_id')}:</label>
<label class="control-label col-xs-12 col-sm-2">责任人:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-firmemployee_id" data-rule="required"
data-source="auth/admin/index" class="form-control selectpage"
data-field="nickname"
name="row[firmemployee_id]" type="text" value="{$row.firmemployee_id|htmlentities}">
name="row[admin_id]" type="text" value="{$row.admin_id|htmlentities}">
</div>
</div>
<div class="form-group">

View File

@@ -29,6 +29,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
{field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'full_name', title: __('Full_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'address', title: __('Address'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'aicustomerservice_ids', title: __('Aicustomerservice_ids'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
]