修正版本:还缺少数据同步
This commit is contained in:
@@ -8,6 +8,8 @@ use app\admin\model\split\Link as LinkModel;
|
||||
use app\admin\model\split\Ticket as TicketModel;
|
||||
use app\common\controller\Backend;
|
||||
use think\Db;
|
||||
use think\Lang;
|
||||
use think\Loader;
|
||||
use think\Exception;
|
||||
use think\exception\DbException;
|
||||
use think\exception\PDOException;
|
||||
@@ -45,15 +47,6 @@ class Ticket extends Backend
|
||||
|
||||
$lang = $this->request->langset();
|
||||
$lang = preg_match('/^([a-zA-Z\-_]{2,10})$/i', $lang) ? $lang : 'zh-cn';
|
||||
$langFile = ROOT_PATH . 'patches/application/admin/lang/' . $lang . '/split/ticket.php';
|
||||
if (is_file($langFile)) {
|
||||
\think\Lang::load($langFile);
|
||||
}
|
||||
$linkLangFile = ROOT_PATH . 'patches/application/admin/lang/' . $lang . '/split/link.php';
|
||||
if (is_file($linkLangFile)) {
|
||||
\think\Lang::load($linkLangFile);
|
||||
}
|
||||
|
||||
$this->model = new \app\admin\model\split\Ticket();
|
||||
$this->view->assign('ticketTypeList', $this->model->getTicketTypeList());
|
||||
$this->view->assign('numberTypeList', $this->model->getNumberTypeList());
|
||||
@@ -66,6 +59,32 @@ class Ticket extends Backend
|
||||
$this->setupPatchFrontend();
|
||||
}
|
||||
|
||||
/**
|
||||
* 加载工单语言包(优先 patches)
|
||||
*/
|
||||
protected function loadlang($name): void
|
||||
{
|
||||
$lang = $this->request->langset();
|
||||
$lang = preg_match('/^([a-zA-Z\-_]{2,10})$/i', $lang) ? $lang : 'zh-cn';
|
||||
$name = Loader::parseName($name);
|
||||
$name = preg_match('/^([a-zA-Z0-9_\.\/]+)$/i', $name) ? $name : 'index';
|
||||
|
||||
$files = [
|
||||
APP_PATH . 'admin/lang/' . $lang . '/' . str_replace('.', '/', $name) . '.php',
|
||||
ROOT_PATH . 'patches/application/admin/lang/' . $lang . '/split/ticket.php',
|
||||
];
|
||||
$loaded = false;
|
||||
foreach ($files as $file) {
|
||||
if (is_file($file)) {
|
||||
Lang::load($file);
|
||||
$loaded = true;
|
||||
}
|
||||
}
|
||||
if (!$loaded) {
|
||||
parent::loadlang($name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 未部署 JS 时指向 script 接口
|
||||
*/
|
||||
|
||||
@@ -39,4 +39,6 @@ return [
|
||||
'Reply statements tip'=> '一行填写一条回复语句,保存后与当前分流链接关联',
|
||||
'Auto reply saved' => '自动回复已保存',
|
||||
'Reply statements column' => '回复语',
|
||||
'NS' => 'NS',
|
||||
'DNS' => 'DNS',
|
||||
];
|
||||
|
||||
@@ -6,8 +6,6 @@ return [
|
||||
'Ticket_url' => '工单链接',
|
||||
'Ticket_total' => '工单总量',
|
||||
'Split_link_id' => '分流链接',
|
||||
'View split link tip' => '点击查看分流链接与复制完整 URL',
|
||||
'Copy link code tip' => '复制链接码',
|
||||
'Number_type' => '号码类型',
|
||||
'Number_type_custom' => '自定义号码类型',
|
||||
'Start_time' => '开始时间',
|
||||
|
||||
Reference in New Issue
Block a user