mirror of
https://gitee.com/niucloud-team/niucloud
synced 2026-08-14 17:35:36 +08:00
up
This commit is contained in:
@@ -100,7 +100,7 @@ class Site extends BaseModel
|
||||
public function searchAppAttr($query, $value, $data)
|
||||
{
|
||||
if ($value != '') {
|
||||
$query->where('app', 'like', '%"' . $value . '"%');
|
||||
$query->where('app', 'like', '%"' . $value . '"%')->whereOr('initalled_addon', 'like', '%"' . $value . '"%');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -56,6 +56,17 @@ class SiteGroup extends BaseModel
|
||||
return (new Addon())->where([['key', 'in', $data['app']]])->column('title');
|
||||
}
|
||||
|
||||
public function getAppListAttr($value, $data)
|
||||
{
|
||||
if (empty($data['app']))
|
||||
return [];
|
||||
$list = (new Addon())->where([['key', 'in', $data['app']]])->column('title,icon');
|
||||
foreach ($list as &$item) {
|
||||
$item['icon'] = is_file($item['icon']) ? image_to_base64($item['icon']) : '';
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关联插件
|
||||
* @param $value
|
||||
@@ -68,6 +79,23 @@ class SiteGroup extends BaseModel
|
||||
return [];
|
||||
return (new Addon())->where([['key', 'in', $data['addon']]])->column('title');
|
||||
}
|
||||
/**
|
||||
* 关联插件
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return array
|
||||
*/
|
||||
public function getAddonListAttr($value, $data)
|
||||
{
|
||||
if (empty($data['addon']))
|
||||
return [];
|
||||
|
||||
$list = (new Addon())->where([['key', 'in', $data['addon']]])->column('title,icon');
|
||||
foreach ($list as &$item) {
|
||||
$item['icon'] = is_file($item['icon']) ? image_to_base64($item['icon']) : '';
|
||||
}
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 关键字搜索
|
||||
|
||||
49
niucloud/app/model/sys/NiuSmsTemplate.php
Normal file
49
niucloud/app/model/sys/NiuSmsTemplate.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的saas管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace app\model\sys;
|
||||
|
||||
|
||||
use app\dict\notice\NoticeTypeDict;
|
||||
use core\base\BaseModel;
|
||||
|
||||
/**
|
||||
* 牛云短信消息模型审核表
|
||||
* Class SysMessage
|
||||
* @package app\model\sys
|
||||
*/
|
||||
class NiuSmsTemplate extends BaseModel
|
||||
{
|
||||
|
||||
/**
|
||||
* 数据表主键
|
||||
* @var string
|
||||
*/
|
||||
protected $pk = 'id';
|
||||
|
||||
public $json = ['report_info','param_json'];
|
||||
public $jsonAssoc = true;
|
||||
/**
|
||||
* 模型名称
|
||||
* @var string
|
||||
*/
|
||||
protected $name = 'niu_sms_template';
|
||||
|
||||
public function getTemplateTypeNameAttr($value, $data)
|
||||
{
|
||||
return NoticeTypeDict::getTemplateType($data['template_type']);
|
||||
}
|
||||
|
||||
public function getAuditStatusNameAttr($value, $data)
|
||||
{
|
||||
return NoticeTypeDict::getTemplateAuditStatus($data['audit_status']);
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
namespace app\model\sys;
|
||||
|
||||
use app\model\site\Site;
|
||||
use core\base\BaseModel;
|
||||
|
||||
/**
|
||||
@@ -42,4 +43,7 @@ class SysConfig extends BaseModel
|
||||
// 设置JSON数据返回数组
|
||||
protected $jsonAssoc = true;
|
||||
|
||||
public function site() {
|
||||
return $this->hasOne(Site::class, 'site_id', 'site_id');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,4 +117,14 @@ class SysUpgradeRecords extends BaseModel
|
||||
{
|
||||
return $this->hasOne(SysBackupRecords::class, 'backup_key', 'upgrade_key');
|
||||
}
|
||||
|
||||
public function getContentAttr($value) {
|
||||
if (!empty($value)) {
|
||||
try {
|
||||
return json_decode($value, true);
|
||||
} catch (\Exception $e) {
|
||||
}
|
||||
}
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user