chore: src/app 目录与华为云第一台服务器上的代码做第一次比较合并
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
<?php
|
||||
|
||||
namespace app\model\web;
|
||||
|
||||
use app\model\system\Config as ConfigModel;
|
||||
@@ -35,7 +34,7 @@ class Config extends BaseModel
|
||||
'btn' => '清除',
|
||||
'icon' => 'public/static/img/cache/template.png'
|
||||
],
|
||||
/* [
|
||||
/* [
|
||||
'name' => '刷新菜单',
|
||||
'desc' => '新增/修改插件菜单后,需要刷新插件菜单',
|
||||
'key' => 'menu_cache',
|
||||
@@ -61,7 +60,7 @@ class Config extends BaseModel
|
||||
public function setCaptchaConfig($data, $site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '验证码设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'CAPTCHA_CONFIG']]);
|
||||
$res = $config->setConfig($data, '验证码设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'CAPTCHA_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -74,20 +73,20 @@ class Config extends BaseModel
|
||||
public function getCaptchaConfig($site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'CAPTCHA_CONFIG']]);
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'CAPTCHA_CONFIG' ] ]);
|
||||
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'shop_login' => 1,
|
||||
'shop_reception_login' => 1,
|
||||
'shop_reception_register' => 1
|
||||
];
|
||||
} else {
|
||||
if (isset($res['data']['value']['shop_reception_login']) === false) {
|
||||
$res['data']['value']['shop_reception_login'] = 1;
|
||||
if (isset($res[ 'data' ][ 'value' ][ 'shop_reception_login' ]) === false) {
|
||||
$res[ 'data' ][ 'value' ][ 'shop_reception_login' ] = 1;
|
||||
}
|
||||
if (isset($res['data']['value']['shop_reception_register']) === false) {
|
||||
$res['data']['value']['shop_reception_register'] = 1;
|
||||
if (isset($res[ 'data' ][ 'value' ][ 'shop_reception_register' ]) === false) {
|
||||
$res[ 'data' ][ 'value' ][ 'shop_reception_register' ] = 1;
|
||||
}
|
||||
}
|
||||
return $res;
|
||||
@@ -102,31 +101,31 @@ class Config extends BaseModel
|
||||
*/
|
||||
public function setDefaultImg($data, $site_id = 0, $app_module = 'shop')
|
||||
{
|
||||
$config_info = $this->getDefaultImg($site_id, $app_module)['data']['value'];
|
||||
$config_info = $this->getDefaultImg($site_id, $app_module)[ 'data' ][ 'value' ];
|
||||
if (!empty($config_info)) {
|
||||
$upload_model = new Upload();
|
||||
if ($data['goods'] && $config_info['goods'] && $data['goods'] != $config_info['goods']) {
|
||||
$upload_model->deletePic($config_info['goods'], $site_id);
|
||||
if ($data[ 'goods' ] && $config_info[ 'goods' ] && $data[ 'goods' ] != $config_info[ 'goods' ]) {
|
||||
$upload_model->deletePic($config_info[ 'goods' ], $site_id);
|
||||
}
|
||||
if ($data['head'] && $config_info['head'] && $data['head'] != $config_info['head']) {
|
||||
$upload_model->deletePic($config_info['head'], $site_id);
|
||||
if ($data[ 'head' ] && $config_info[ 'head' ] && $data[ 'head' ] != $config_info[ 'head' ]) {
|
||||
$upload_model->deletePic($config_info[ 'head' ], $site_id);
|
||||
}
|
||||
if ($data['store'] && $config_info['store'] && $data['store'] != $config_info['store']) {
|
||||
$upload_model->deletePic($config_info['store'], $site_id);
|
||||
if ($data[ 'store' ] && $config_info[ 'store' ] && $data[ 'store' ] != $config_info[ 'store' ]) {
|
||||
$upload_model->deletePic($config_info[ 'store' ], $site_id);
|
||||
}
|
||||
if ($data['article'] && $config_info['article'] && $data['article'] != $config_info['article']) {
|
||||
$upload_model->deletePic($config_info['article'], $site_id);
|
||||
if ($data[ 'article' ] && $config_info[ 'article' ] && $data[ 'article' ] != $config_info[ 'article' ]) {
|
||||
$upload_model->deletePic($config_info[ 'article' ], $site_id);
|
||||
}
|
||||
if ($data['kefu'] && $config_info['kefu'] && $data['kefu'] != $config_info['kefu']) {
|
||||
$upload_model->deletePic($config_info['kefu'], $site_id);
|
||||
if ($data[ 'kefu' ] && $config_info[ 'kefu' ] && $data[ 'kefu' ] != $config_info[ 'kefu' ]) {
|
||||
$upload_model->deletePic($config_info[ 'kefu' ], $site_id);
|
||||
}
|
||||
if ($data['phone'] && $config_info['phone'] && $data['phone'] != $config_info['phone']) {
|
||||
$upload_model->deletePic($config_info['phone'], $site_id);
|
||||
if ($data[ 'phone' ] && $config_info[ 'phone' ] && $data[ 'phone' ] != $config_info[ 'phone' ]) {
|
||||
$upload_model->deletePic($config_info[ 'phone' ], $site_id);
|
||||
}
|
||||
}
|
||||
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '默认图设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DEFAULT_IMAGE']]);
|
||||
$res = $config->setConfig($data, '默认图设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DEFAULT_IMAGE' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -139,9 +138,9 @@ class Config extends BaseModel
|
||||
public function getDefaultImg($site_id, $app_model = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_model], ['config_key', '=', 'DEFAULT_IMAGE']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_model ], [ 'config_key', '=', 'DEFAULT_IMAGE' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'goods' => 'public/static/img/default_img/square.png',
|
||||
'head' => 'public/static/img/default_img/head.png',
|
||||
'store' => 'public/static/img/default_img/store.png',
|
||||
@@ -151,14 +150,14 @@ class Config extends BaseModel
|
||||
];
|
||||
}
|
||||
|
||||
if (empty($res['data']['value']['head'])) {
|
||||
$res['data']['value']['head'] = 'public/static/img/default_img/head.png';
|
||||
if (empty($res[ 'data' ][ 'value' ][ 'head' ])) {
|
||||
$res[ 'data' ][ 'value' ][ 'head' ] = 'public/static/img/default_img/head.png';
|
||||
}
|
||||
if (empty($res['data']['value']['article'])) {
|
||||
$res['data']['value']['article'] = 'public/static/img/default_img/article.png';
|
||||
if (empty($res[ 'data' ][ 'value' ][ 'article' ])) {
|
||||
$res[ 'data' ][ 'value' ][ 'article' ] = 'public/static/img/default_img/article.png';
|
||||
}
|
||||
if (empty($res['data']['value']['store'])) {
|
||||
$res['data']['value']['store'] = 'public/static/img/default_img/store.png';
|
||||
if (empty($res[ 'data' ][ 'value' ][ 'store' ])) {
|
||||
$res[ 'data' ][ 'value' ][ 'store' ] = 'public/static/img/default_img/store.png';
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
@@ -174,7 +173,7 @@ class Config extends BaseModel
|
||||
public function setCopyright($data, $site_id = 1, $app_model = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '版权设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_model], ['config_key', '=', 'COPYRIGHT']]);
|
||||
$res = $config->setConfig($data, '版权设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_model ], [ 'config_key', '=', 'COPYRIGHT' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -187,16 +186,16 @@ class Config extends BaseModel
|
||||
public function getCopyright($site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'COPYRIGHT']]);
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'COPYRIGHT' ] ]);
|
||||
|
||||
$auth_info = cache('auth_info_copyright');
|
||||
if (empty($auth_info)) {
|
||||
$upgrade_model = new Upgrade();
|
||||
$auth_info = $upgrade_model->authInfo();
|
||||
cache('auth_info_copyright', $auth_info, ['expire' => 604800]);
|
||||
cache('auth_info_copyright', $auth_info, [ 'expire' => 604800 ]);
|
||||
}
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'logo' => '',
|
||||
'company_name' => '',
|
||||
'copyright_link' => '',
|
||||
@@ -207,15 +206,16 @@ class Config extends BaseModel
|
||||
'market_supervision_url' => ''
|
||||
];
|
||||
} else {
|
||||
if (is_null($auth_info) || $auth_info['code'] != 0) {
|
||||
$res['data']['value']['logo'] = '';
|
||||
$res['data']['value']['company_name'] = '';
|
||||
$res['data']['value']['copyright_link'] = '';
|
||||
$res['data']['value']['copyright_desc'] = '';
|
||||
if (is_null($auth_info) || $auth_info[ 'code' ] != 0) {
|
||||
$res[ 'data' ][ 'value' ][ 'logo' ] = '';
|
||||
$res[ 'data' ][ 'value' ][ 'company_name' ] = '';
|
||||
$res[ 'data' ][ 'value' ][ 'copyright_link' ] = '';
|
||||
$res[ 'data' ][ 'value' ][ 'copyright_desc' ] = '';
|
||||
}
|
||||
|
||||
}
|
||||
// 检查是否授权
|
||||
$res['data']['value']['auth'] = true;
|
||||
$res[ 'data' ][ 'value' ][ 'auth' ] = true;
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ class Config extends BaseModel
|
||||
public function setAuth($data, $site_id = 1, $app_model = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '授权设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_model], ['config_key', '=', 'AUTH']]);
|
||||
$res = $config->setConfig($data, '授权设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_model ], [ 'config_key', '=', 'AUTH' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -240,9 +240,9 @@ class Config extends BaseModel
|
||||
public function getAuth($site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'AUTH']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'AUTH' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'code' => '',
|
||||
];
|
||||
}
|
||||
@@ -259,11 +259,11 @@ class Config extends BaseModel
|
||||
public function setMapConfig($data, $site_id, $app_model = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '地图设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_model], ['config_key', '=', 'MAP_CONFIG']]);
|
||||
$res = $config->setConfig($data, '地图设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_model ], [ 'config_key', '=', 'MAP_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* 获取地图设置
|
||||
* @param int $site_id
|
||||
* @param string $app_module
|
||||
@@ -273,16 +273,16 @@ class Config extends BaseModel
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'MAP_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
'tencent_map_key' => '2PJBZ-A263Q-SED5B-4SAAB-HCUQ5-DUFHE', //默认一个地图TB5BZ-FBRRX-2RJ4C-76SZY-TYQ3H-F4BFC
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'tencent_map_key' => '2PJBZ-A263Q-SED5B-4SAAB-HCUQ5-DUFHE',//默认一个地图TB5BZ-FBRRX-2RJ4C-76SZY-TYQ3H-F4BFC
|
||||
'wap_is_open' => 1, // 手机端是否开启定位
|
||||
'wap_valid_time' => 5 // 手机端定位有效期/分钟,过期后将重新获取定位信息,0为不过期
|
||||
];
|
||||
}
|
||||
$res['data']['value']['wap_is_open'] = $res['data']['value']['wap_is_open'] ?? 1;
|
||||
$res['data']['value']['wap_valid_time'] = $res['data']['value']['wap_valid_time'] ?? 5;
|
||||
$res['data']['value']['tencent_map_key'] = '2PJBZ-A263Q-SED5B-4SAAB-HCUQ5-DUFHE';
|
||||
$res[ 'data' ][ 'value' ][ 'wap_is_open' ] = $res[ 'data' ][ 'value' ][ 'wap_is_open' ] ?? 1;
|
||||
$res[ 'data' ][ 'value' ][ 'wap_valid_time' ] = $res[ 'data' ][ 'value' ][ 'wap_valid_time' ] ?? 5;
|
||||
$res[ 'data' ][ 'value' ]['tencent_map_key'] = '2PJBZ-A263Q-SED5B-4SAAB-HCUQ5-DUFHE';
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -296,19 +296,19 @@ class Config extends BaseModel
|
||||
public function seth5DomainName($data, $site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$search = '/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/';
|
||||
if ($data['deploy_way'] == 'separate') {
|
||||
if (!preg_match($search, $data['domain_name_h5'])) {
|
||||
if ($data[ 'deploy_way' ] == 'separate') {
|
||||
if (!preg_match($search, $data[ 'domain_name_h5' ])) {
|
||||
return $this->error('', '请输入正确的域名地址');
|
||||
}
|
||||
}
|
||||
// 默认部署,更新店铺域名
|
||||
if ($data['deploy_way'] == 'default') {
|
||||
if ($data[ 'deploy_way' ] == 'default') {
|
||||
$this->setShopDomainConfig([
|
||||
'domain_name' => __ROOT__
|
||||
], $site_id);
|
||||
}
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, 'H5域名配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'H5_DOMAIN_NAME']]);
|
||||
$res = $config->setConfig($data, 'H5域名配置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'H5_DOMAIN_NAME' ] ]);
|
||||
|
||||
return $res;
|
||||
}
|
||||
@@ -322,9 +322,9 @@ class Config extends BaseModel
|
||||
public function getH5DomainName($site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'H5_DOMAIN_NAME']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'H5_DOMAIN_NAME' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'domain_name_h5' => __ROOT__ . '/h5',
|
||||
'deploy_way' => 'default'
|
||||
];
|
||||
@@ -342,7 +342,7 @@ class Config extends BaseModel
|
||||
public function setDomainJumpConfig($data, $site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '获取域名跳转配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DOMAIN_JUMP_CONFIG']]);
|
||||
$res = $config->setConfig($data, '获取域名跳转配置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DOMAIN_JUMP_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -356,12 +356,12 @@ class Config extends BaseModel
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([
|
||||
['site_id', '=', $site_id],
|
||||
['app_module', '=', $app_module],
|
||||
['config_key', '=', 'DOMAIN_JUMP_CONFIG']
|
||||
[ 'site_id', '=', $site_id ],
|
||||
[ 'app_module', '=', $app_module ],
|
||||
[ 'config_key', '=', 'DOMAIN_JUMP_CONFIG' ]
|
||||
]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'jump_type' => 3, // 1:用户前台,2:商家后台,3:引导页
|
||||
];
|
||||
}
|
||||
@@ -378,19 +378,19 @@ class Config extends BaseModel
|
||||
public function setPcDomainName($data, $site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$search = '/^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/';
|
||||
if ($data['deploy_way'] == 'separate') {
|
||||
if (!preg_match($search, $data['domain_name_pc'])) {
|
||||
if ($data[ 'deploy_way' ] == 'separate') {
|
||||
if (!preg_match($search, $data[ 'domain_name_pc' ])) {
|
||||
return $this->error('', '请输入正确的域名地址');
|
||||
}
|
||||
}
|
||||
// 默认部署,更新店铺域名
|
||||
if ($data['deploy_way'] == 'default') {
|
||||
if ($data[ 'deploy_way' ] == 'default') {
|
||||
$this->setShopDomainConfig([
|
||||
'domain_name' => __ROOT__
|
||||
], $site_id);
|
||||
}
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, 'PC域名配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'PC_DOMAIN_NAME']]);
|
||||
$res = $config->setConfig($data, 'PC域名配置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'PC_DOMAIN_NAME' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -403,19 +403,19 @@ class Config extends BaseModel
|
||||
public function getPcDomainName($site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'PC_DOMAIN_NAME']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'PC_DOMAIN_NAME' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'domain_name_pc' => __ROOT__ . '/web',
|
||||
'deploy_way' => 'default'
|
||||
];
|
||||
} else {
|
||||
if ($res['data']['value']['domain_name_pc'] == '' || empty($res['data']['value']['deploy_way']) || $res['data']['value']['deploy_way'] == 'default') {
|
||||
$res['data']['value'] = [
|
||||
if ($res[ 'data' ][ 'value' ][ 'domain_name_pc' ] == '' || empty($res[ 'data' ][ 'value' ][ 'deploy_way' ]) || $res[ 'data' ][ 'value' ][ 'deploy_way' ] == 'default') {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'domain_name_pc' => __ROOT__ . '/web'
|
||||
];
|
||||
}
|
||||
$res['data']['value']['deploy_way'] = $res['data']['value']['deploy_way'] ?? 'default';
|
||||
$res[ 'data' ][ 'value' ][ 'deploy_way' ] = $res[ 'data' ][ 'value' ][ 'deploy_way' ] ?? 'default';
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
@@ -430,7 +430,7 @@ class Config extends BaseModel
|
||||
public function setHotSearchWords($data, $site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '商品热门搜索关键词', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_HOT_SEARCH_WORDS_CONFIG']]);
|
||||
$res = $config->setConfig($data, '商品热门搜索关键词', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_HOT_SEARCH_WORDS_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -443,9 +443,9 @@ class Config extends BaseModel
|
||||
public function getHotSearchWords($site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_HOT_SEARCH_WORDS_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_HOT_SEARCH_WORDS_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'words' => ''
|
||||
];
|
||||
}
|
||||
@@ -462,7 +462,7 @@ class Config extends BaseModel
|
||||
public function setGuessYouLike($data, $site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '商品推荐', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_GUESS_YOU_LIKE_CONFIG']]);
|
||||
$res = $config->setConfig($data, '商品推荐', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_GUESS_YOU_LIKE_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -475,11 +475,11 @@ class Config extends BaseModel
|
||||
public function getGuessYouLike($site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_GUESS_YOU_LIKE_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_GUESS_YOU_LIKE_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'title' => '猜你喜欢',
|
||||
'supportPage' => ['goods_detail', 'cart', 'collect', 'pay', 'order_detail', 'super_member', 'guafen', 'fenxiao_level'],
|
||||
'supportPage' => [ 'goods_detail', 'cart', 'collect', 'pay', 'order_detail', 'super_member', 'guafen', 'fenxiao_level' ],
|
||||
'sources' => 'sort',
|
||||
'goodsIds' => [],
|
||||
'fontWeight' => false,
|
||||
@@ -508,7 +508,7 @@ class Config extends BaseModel
|
||||
],
|
||||
];
|
||||
}
|
||||
$res['data']['value']['nameLineMode'] = $res['data']['value']['nameLineMode'] ?? 'single'; // 商品名称,单行、多行展示
|
||||
$res[ 'data' ][ 'value' ][ 'nameLineMode' ] = $res[ 'data' ][ 'value' ][ 'nameLineMode' ] ?? 'single'; // 商品名称,单行、多行展示
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -522,17 +522,17 @@ class Config extends BaseModel
|
||||
public function getDiyAdv($site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DIY_STARTADV']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
'list' => [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DIY_STARTADV' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])){
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'list' =>[
|
||||
[
|
||||
'title' => '启动广告',
|
||||
'link' => [
|
||||
'name' => ''
|
||||
'title'=>'启动广告',
|
||||
'link'=>[
|
||||
'name'=>''
|
||||
],
|
||||
'iconType' => 'img',
|
||||
'imageUrl' => "public/static/ext/diyview/img/preview/advs_default.png"
|
||||
'iconType'=>'img',
|
||||
'imageUrl'=>"public/static/ext/diyview/img/preview/advs_default.png"
|
||||
]
|
||||
],
|
||||
'advtype' => 1,
|
||||
@@ -552,12 +552,12 @@ class Config extends BaseModel
|
||||
public function setDiyAdv($data, $site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '启动广告', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DIY_STARTADV']]);
|
||||
$res = $config->setConfig($data, '启动广告', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DIY_STARTADV' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* 获取VR
|
||||
* @param $site_id
|
||||
* @param $app_module
|
||||
@@ -566,14 +566,14 @@ class Config extends BaseModel
|
||||
public function getDiyVr($site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DIY_VR']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DIY_VR' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])){
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'title' => '工厂展示',
|
||||
'url' => 'https://baidu.com',
|
||||
];
|
||||
}
|
||||
// $res[ 'data' ][ 'value' ][ 'nameLineMode' ] = $res[ 'data' ][ 'value' ][ 'nameLineMode' ] ?? 'single'; // 商品名称,单行、多行展示
|
||||
// $res[ 'data' ][ 'value' ][ 'nameLineMode' ] = $res[ 'data' ][ 'value' ][ 'nameLineMode' ] ?? 'single'; // 商品名称,单行、多行展示
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ class Config extends BaseModel
|
||||
public function setDiyVr($data, $site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, 'VR展示', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'DIY_VR']]);
|
||||
$res = $config->setConfig($data, 'VR展示', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'DIY_VR' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -602,7 +602,7 @@ class Config extends BaseModel
|
||||
public function setGoodsListConfig($data, $site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '商品列表配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_LIST_CONFIG']]);
|
||||
$res = $config->setConfig($data, '商品列表配置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_LIST_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -615,9 +615,9 @@ class Config extends BaseModel
|
||||
public function getGoodsListConfig($site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_LIST_CONFIG']]);
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_LIST_CONFIG' ] ]);
|
||||
//数据格式化
|
||||
if (empty($res['data']['value'])) {
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$data = [
|
||||
'fontWeight' => false,
|
||||
'padding' => 10,
|
||||
@@ -644,9 +644,9 @@ class Config extends BaseModel
|
||||
]
|
||||
]
|
||||
];
|
||||
$res['data']['value'] = $data;
|
||||
$res[ 'data' ][ 'value' ] = $data;
|
||||
}
|
||||
$res['data']['value']['nameLineMode'] = $res['data']['value']['nameLineMode'] ?? 'single'; // 商品名称,单行、多行展示
|
||||
$res[ 'data' ][ 'value' ][ 'nameLineMode' ] = $res[ 'data' ][ 'value' ][ 'nameLineMode' ] ?? 'single'; // 商品名称,单行、多行展示
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -660,7 +660,7 @@ class Config extends BaseModel
|
||||
public function setDefaultSearchWords($data, $site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '默认搜索关键词', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_DEFAULT_SEARCH_WORDS_CONFIG']]);
|
||||
$res = $config->setConfig($data, '默认搜索关键词', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_DEFAULT_SEARCH_WORDS_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -673,9 +673,9 @@ class Config extends BaseModel
|
||||
public function getDefaultSearchWords($site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_DEFAULT_SEARCH_WORDS_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_DEFAULT_SEARCH_WORDS_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'words' => '搜索 商品'
|
||||
];
|
||||
}
|
||||
@@ -692,7 +692,7 @@ class Config extends BaseModel
|
||||
public function setGoodsSort($data, $site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '商品默认排序方式', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_SORT_CONFIG']]);
|
||||
$res = $config->setConfig($data, '商品默认排序方式', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_SORT_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -705,9 +705,9 @@ class Config extends BaseModel
|
||||
public function getGoodsSort($site_id, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_SORT_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_SORT_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'type' => 'asc',
|
||||
'default_value' => 100
|
||||
];
|
||||
@@ -725,7 +725,7 @@ class Config extends BaseModel
|
||||
public function setCategoryConfig($data, $site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, 'PC端首页分类设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'SHOP_CATEGORY_CONFIG']]);
|
||||
$res = $config->setConfig($data, 'PC端首页分类设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'SHOP_CATEGORY_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -738,9 +738,9 @@ class Config extends BaseModel
|
||||
public function getCategoryConfig($site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'SHOP_CATEGORY_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'SHOP_CATEGORY_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'category' => 1,
|
||||
'img' => 1
|
||||
];
|
||||
@@ -758,7 +758,7 @@ class Config extends BaseModel
|
||||
public function setGoodsDetailConfig($data, $site_id, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '商品详情配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_DETAIL_CONFIG']]);
|
||||
$res = $config->setConfig($data, '商品详情配置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_DETAIL_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -771,9 +771,9 @@ class Config extends BaseModel
|
||||
public function getGoodsDetailConfig($site_id, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_DETAIL_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_DETAIL_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'nav_bar_switch' => 0, // 是否透明,0:不透明,1:透明
|
||||
'introduction_color' => '#303133',
|
||||
];
|
||||
@@ -791,7 +791,7 @@ class Config extends BaseModel
|
||||
public function setShopDomainConfig($data, $site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '店铺域名配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'SHOP_DOMAIN_CONFIG']]);
|
||||
$res = $config->setConfig($data, '店铺域名配置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'SHOP_DOMAIN_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -804,12 +804,12 @@ class Config extends BaseModel
|
||||
public function getShopDomainConfig($site_id = 1, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'SHOP_DOMAIN_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'SHOP_DOMAIN_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'domain_name' => __ROOT__,
|
||||
];
|
||||
$this->setShopDomainConfig($res['data']['value'], $site_id);
|
||||
$this->setShopDomainConfig($res[ 'data' ][ 'value' ], $site_id);
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
@@ -817,11 +817,11 @@ class Config extends BaseModel
|
||||
{
|
||||
$qq_map = new \app\model\map\QqMap(['key' => $tencent_map_key]);
|
||||
$res = $qq_map->ipToDetail([
|
||||
'ip' => request()->ip() != '127.0.0.1' ? $_SERVER['REMOTE_ADDR'] : '',
|
||||
'ip' => request()->ip() != '127.0.0.1' ? $_SERVER[ 'REMOTE_ADDR' ] : '',
|
||||
]);
|
||||
if (!empty($res)) {
|
||||
if ($res['status'] != 0 && $type == 0) {
|
||||
$res['message'] = '腾讯地图配置错误,无法定位地址';
|
||||
if ($res[ 'status' ] != 0 && $type == 0) {
|
||||
$res[ 'message' ] = '腾讯地图配置错误,无法定位地址';
|
||||
}
|
||||
}
|
||||
return $res;
|
||||
@@ -857,7 +857,7 @@ class Config extends BaseModel
|
||||
public function setGoodsNo($data, $site_id, $app_module)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '商品编码设置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_NO_CONFIG']]);
|
||||
$res = $config->setConfig($data, '商品编码设置', 1, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_NO_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
@@ -870,12 +870,12 @@ class Config extends BaseModel
|
||||
public function getGoodsNo($site_id, $app_module = 'shop')
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'GOODS_NO_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', $app_module ], [ 'config_key', '=', 'GOODS_NO_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'uniqueness_switch' => 1,
|
||||
];
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user