|
@@ -40,39 +40,41 @@ class Setting extends BaseModel
|
|
|
{
|
|
{
|
|
|
$data = self::getAll($app_id);
|
|
$data = self::getAll($app_id);
|
|
|
$data_key = $data[$key];
|
|
$data_key = $data[$key];
|
|
|
- if(isset($data_key)){
|
|
|
|
|
|
|
+ if (isset($data_key)) {
|
|
|
$data_key = $data[$key]['values'];
|
|
$data_key = $data[$key]['values'];
|
|
|
jsonRecursive($data_key);
|
|
jsonRecursive($data_key);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
$data_key = [];
|
|
$data_key = [];
|
|
|
}
|
|
}
|
|
|
return $data_key;
|
|
return $data_key;
|
|
|
}
|
|
}
|
|
|
- /**
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 获取系统配置
|
|
* 获取系统配置
|
|
|
*/
|
|
*/
|
|
|
public static function getSysConfig()
|
|
public static function getSysConfig()
|
|
|
{
|
|
{
|
|
|
$model = new static;
|
|
$model = new static;
|
|
|
$result = $model->withoutGlobalScope()->where('key', '=', SettingEnum::SYS_CONFIG)->value('values');
|
|
$result = $model->withoutGlobalScope()->where('key', '=', SettingEnum::SYS_CONFIG)->value('values');
|
|
|
- if(!$result){
|
|
|
|
|
|
|
+ if (!$result) {
|
|
|
$result = $model->defaultData()[SettingEnum::SYS_CONFIG]['values'];
|
|
$result = $model->defaultData()[SettingEnum::SYS_CONFIG]['values'];
|
|
|
- }else{
|
|
|
|
|
- $result = json_decode($result,true);
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $result = json_decode($result, true);
|
|
|
}
|
|
}
|
|
|
return $result;
|
|
return $result;
|
|
|
}
|
|
}
|
|
|
- /**
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
* 获取指定项设置
|
|
* 获取指定项设置
|
|
|
*/
|
|
*/
|
|
|
public static function getSupplierItem($key, $shop_supplier_id, $app_id = null)
|
|
public static function getSupplierItem($key, $shop_supplier_id, $app_id = null)
|
|
|
{
|
|
{
|
|
|
$data = self::getAll($app_id, $shop_supplier_id);
|
|
$data = self::getAll($app_id, $shop_supplier_id);
|
|
|
$data_key = $data[$key];
|
|
$data_key = $data[$key];
|
|
|
- if(isset($data_key)){
|
|
|
|
|
|
|
+ if (isset($data_key)) {
|
|
|
$data_key = $data[$key]['values'];
|
|
$data_key = $data[$key]['values'];
|
|
|
jsonRecursive($data_key);
|
|
jsonRecursive($data_key);
|
|
|
- }else{
|
|
|
|
|
|
|
+ } else {
|
|
|
$data_key = [];
|
|
$data_key = [];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -82,10 +84,10 @@ class Setting extends BaseModel
|
|
|
/**
|
|
/**
|
|
|
* 获取设置项信息
|
|
* 获取设置项信息
|
|
|
*/
|
|
*/
|
|
|
- public static function detail($key,$shop_supplier_id=0)
|
|
|
|
|
- {
|
|
|
|
|
|
|
+ public static function detail($key, $shop_supplier_id = 0)
|
|
|
|
|
+ {
|
|
|
$where = [];
|
|
$where = [];
|
|
|
- if($shop_supplier_id){
|
|
|
|
|
|
|
+ if ($shop_supplier_id) {
|
|
|
$where['shop_supplier_id'] = $shop_supplier_id;
|
|
$where['shop_supplier_id'] = $shop_supplier_id;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -102,7 +104,7 @@ class Setting extends BaseModel
|
|
|
if (!$data = Cache::get('setting_' . $app_id . '_' . $shop_supplier_id)) {
|
|
if (!$data = Cache::get('setting_' . $app_id . '_' . $shop_supplier_id)) {
|
|
|
$setting = $static->where(compact('app_id'))->where('shop_supplier_id', $shop_supplier_id)->select();
|
|
$setting = $static->where(compact('app_id'))->where('shop_supplier_id', $shop_supplier_id)->select();
|
|
|
$data = empty($setting) ? [] : array_column($static->collection($setting)->toArray(), null, 'key');
|
|
$data = empty($setting) ? [] : array_column($static->collection($setting)->toArray(), null, 'key');
|
|
|
- Cache::tag('cache')->set('setting_' . $app_id. '_' .$shop_supplier_id, $data);
|
|
|
|
|
|
|
+ Cache::tag('cache')->set('setting_' . $app_id . '_' . $shop_supplier_id, $data);
|
|
|
}
|
|
}
|
|
|
return $static->getMergeData($data);
|
|
return $static->getMergeData($data);
|
|
|
}
|
|
}
|
|
@@ -137,7 +139,8 @@ class Setting extends BaseModel
|
|
|
/**
|
|
/**
|
|
|
* 店铺是否开启
|
|
* 店铺是否开启
|
|
|
*/
|
|
*/
|
|
|
- public static function getStoreOpen(){
|
|
|
|
|
|
|
+ public static function getStoreOpen()
|
|
|
|
|
+ {
|
|
|
$data = (new static())->getItem(SettingEnum::BOTTOMNAV);
|
|
$data = (new static())->getItem(SettingEnum::BOTTOMNAV);
|
|
|
return $data['menu_type'] == 1;
|
|
return $data['menu_type'] == 1;
|
|
|
}
|
|
}
|
|
@@ -146,7 +149,7 @@ class Setting extends BaseModel
|
|
|
* 默认配置
|
|
* 默认配置
|
|
|
*/
|
|
*/
|
|
|
public function defaultData($storeName = null)
|
|
public function defaultData($storeName = null)
|
|
|
- {
|
|
|
|
|
|
|
+ {
|
|
|
$url = base_url();
|
|
$url = base_url();
|
|
|
return [
|
|
return [
|
|
|
'store' => [
|
|
'store' => [
|
|
@@ -242,7 +245,7 @@ class Setting extends BaseModel
|
|
|
'aliyun' => [
|
|
'aliyun' => [
|
|
|
'AccessKeyId' => '',
|
|
'AccessKeyId' => '',
|
|
|
'AccessKeySecret' => '',
|
|
'AccessKeySecret' => '',
|
|
|
- 'sign' => '三勾商城',
|
|
|
|
|
|
|
+ 'sign' => '小程序商城',
|
|
|
'login_template' => '',
|
|
'login_template' => '',
|
|
|
'apply_template' => '',
|
|
'apply_template' => '',
|
|
|
'supplier_reject_code' => '',
|
|
'supplier_reject_code' => '',
|
|
@@ -434,7 +437,7 @@ class Setting extends BaseModel
|
|
|
// 显示区域
|
|
// 显示区域
|
|
|
'area_type' => [],
|
|
'area_type' => [],
|
|
|
// 不再提示天数
|
|
// 不再提示天数
|
|
|
- 'send_day' => 7
|
|
|
|
|
|
|
+ 'send_day' => 7
|
|
|
],
|
|
],
|
|
|
],
|
|
],
|
|
|
'live' => [
|
|
'live' => [
|
|
@@ -446,7 +449,7 @@ class Setting extends BaseModel
|
|
|
//是否开启审核
|
|
//是否开启审核
|
|
|
'is_audit' => '1',
|
|
'is_audit' => '1',
|
|
|
//礼物名称
|
|
//礼物名称
|
|
|
- 'gift_name'=>'玖币',
|
|
|
|
|
|
|
+ 'gift_name' => '玖币',
|
|
|
// appid
|
|
// appid
|
|
|
'sdkappid' => '',
|
|
'sdkappid' => '',
|
|
|
// key
|
|
// key
|
|
@@ -486,19 +489,19 @@ class Setting extends BaseModel
|
|
|
'key' => 'nav',
|
|
'key' => 'nav',
|
|
|
'describe' => '底部导航',
|
|
'describe' => '底部导航',
|
|
|
'values' => [
|
|
'values' => [
|
|
|
- 'data'=>[
|
|
|
|
|
- "type"=>0,
|
|
|
|
|
- "backgroundColor"=>"#FFFFFF",
|
|
|
|
|
- "textColor"=>"#000000",
|
|
|
|
|
- "textHoverColor"=>"#E2231A",
|
|
|
|
|
- "bulge"=>"true",
|
|
|
|
|
- "list"=>[
|
|
|
|
|
- ["iconPath"=>$url."image/diy/navbar/home.png","text"=>"首页","is_show"=>"true","selectedIconPath"=>$url."image/diy/navbar/home-on.png","link"=>["wap_url"=>"/pages/index/index"]],
|
|
|
|
|
- ["iconPath"=>$url."image/diy/navbar/fl.png","text"=>"分类","is_show"=>"true","selectedIconPath"=>$url."image/diy/navbar/fl-on.png","link"=>["wap_url"=>"/pages/product/category"]],
|
|
|
|
|
- ["iconPath"=>$url."image/diy/navbar/store.png","text"=>"店铺","is_show"=>"true","selectedIconPath"=>$url."image/diy/navbar/store-on.png","link"=>["wap_url"=>"/pages/shop/shop_list"]],
|
|
|
|
|
- ["iconPath"=>$url."image/diy/navbar/cart.png","text"=>"购物车","is_show"=>"true","selectedIconPath"=>$url."image/diy/navbar/cart-on.png","link"=>["wap_url"=>"/pages/cart/cart"]],
|
|
|
|
|
- ["iconPath"=>$url."image/diy/navbar/wode.png","text"=>"我的","is_show"=>"true","selectedIconPath"=>$url."image/diy/navbar/wode-on.png","link"=>["wap_url"=>"/pages/user/index/index"]]
|
|
|
|
|
- ]
|
|
|
|
|
|
|
+ 'data' => [
|
|
|
|
|
+ "type" => 0,
|
|
|
|
|
+ "backgroundColor" => "#FFFFFF",
|
|
|
|
|
+ "textColor" => "#000000",
|
|
|
|
|
+ "textHoverColor" => "#E2231A",
|
|
|
|
|
+ "bulge" => "true",
|
|
|
|
|
+ "list" => [
|
|
|
|
|
+ ["iconPath" => $url . "image/diy/navbar/home.png", "text" => "首页", "is_show" => "true", "selectedIconPath" => $url . "image/diy/navbar/home-on.png", "link" => ["wap_url" => "/pages/index/index"]],
|
|
|
|
|
+ ["iconPath" => $url . "image/diy/navbar/fl.png", "text" => "分类", "is_show" => "true", "selectedIconPath" => $url . "image/diy/navbar/fl-on.png", "link" => ["wap_url" => "/pages/product/category"]],
|
|
|
|
|
+ ["iconPath" => $url . "image/diy/navbar/store.png", "text" => "店铺", "is_show" => "true", "selectedIconPath" => $url . "image/diy/navbar/store-on.png", "link" => ["wap_url" => "/pages/shop/shop_list"]],
|
|
|
|
|
+ ["iconPath" => $url . "image/diy/navbar/cart.png", "text" => "购物车", "is_show" => "true", "selectedIconPath" => $url . "image/diy/navbar/cart-on.png", "link" => ["wap_url" => "/pages/cart/cart"]],
|
|
|
|
|
+ ["iconPath" => $url . "image/diy/navbar/wode.png", "text" => "我的", "is_show" => "true", "selectedIconPath" => $url . "image/diy/navbar/wode-on.png", "link" => ["wap_url" => "/pages/user/index/index"]]
|
|
|
|
|
+ ]
|
|
|
]
|
|
]
|
|
|
]
|
|
]
|
|
|
],
|
|
],
|
|
@@ -506,9 +509,9 @@ class Setting extends BaseModel
|
|
|
'key' => 'sys_config',
|
|
'key' => 'sys_config',
|
|
|
'describe' => '系统设置',
|
|
'describe' => '系统设置',
|
|
|
'values' => [
|
|
'values' => [
|
|
|
- 'shop_name' => '三勾商城管理系统',
|
|
|
|
|
|
|
+ 'shop_name' => '商城管理系统',
|
|
|
'shop_bg_img' => '',
|
|
'shop_bg_img' => '',
|
|
|
- 'supplier_name' => '三勾商城供应商管理系统',
|
|
|
|
|
|
|
+ 'supplier_name' => '商城供应商管理系统',
|
|
|
'supplier_bg_img' => '',
|
|
'supplier_bg_img' => '',
|
|
|
'url' => 'wss://',
|
|
'url' => 'wss://',
|
|
|
'service_open' => 0,
|
|
'service_open' => 0,
|
|
@@ -526,7 +529,7 @@ class Setting extends BaseModel
|
|
|
'min_money' => 1,
|
|
'min_money' => 1,
|
|
|
// 充值说明
|
|
// 充值说明
|
|
|
'describe' => "a) 账户充值仅限在线方式支付,充值金额实时到账;\n" .
|
|
'describe' => "a) 账户充值仅限在线方式支付,充值金额实时到账;\n" .
|
|
|
- "b) 有问题请联系客服;\n" ,
|
|
|
|
|
|
|
+ "b) 有问题请联系客服;\n",
|
|
|
]
|
|
]
|
|
|
],
|
|
],
|
|
|
'h5Alipay' => [
|
|
'h5Alipay' => [
|
|
@@ -558,38 +561,65 @@ class Setting extends BaseModel
|
|
|
[
|
|
[
|
|
|
'index' => 0,
|
|
'index' => 0,
|
|
|
'text' => '首页',
|
|
'text' => '首页',
|
|
|
- 'iconPath' => self::$base_url .'image/tabbar/home.png',
|
|
|
|
|
- 'selectedIconPath' => self::$base_url .'image/tabbar/home_active.png',
|
|
|
|
|
|
|
+ 'iconPath' => self::$base_url . 'image/tabbar/shop.png',
|
|
|
|
|
+ 'selectedIconPath' => self::$base_url . 'image/tabbar/shop_active.png',
|
|
|
|
|
+ ],
|
|
|
|
|
+ [
|
|
|
|
|
+ 'index' => 1,
|
|
|
|
|
+ 'text' => '商品',
|
|
|
|
|
+ 'iconPath' => self::$base_url . 'image/tabbar/goods.png',
|
|
|
|
|
+ 'selectedIconPath' => self::$base_url . 'image/tabbar/goods_active.png',
|
|
|
|
|
+ ],
|
|
|
|
|
+ [
|
|
|
|
|
+ 'index' => 3,
|
|
|
|
|
+ 'text' => '购物车',
|
|
|
|
|
+ 'iconPath' => self::$base_url . 'image/tabbar/cart.png',
|
|
|
|
|
+ 'selectedIconPath' => self::$base_url . 'image/tabbar/cart_active.png',
|
|
|
|
|
+ ],
|
|
|
|
|
+ [
|
|
|
|
|
+ 'index' => 4,
|
|
|
|
|
+ 'text' => '我的',
|
|
|
|
|
+ 'iconPath' => self::$base_url . 'image/tabbar/user.png',
|
|
|
|
|
+ 'selectedIconPath' => self::$base_url . 'image/tabbar/user_active.png',
|
|
|
|
|
+ ],
|
|
|
|
|
+ ],
|
|
|
|
|
+
|
|
|
|
|
+ 'menus1' => [
|
|
|
|
|
+ [
|
|
|
|
|
+ 'index' => 0,
|
|
|
|
|
+ 'text' => '首页',
|
|
|
|
|
+ 'iconPath' => self::$base_url . 'image/tabbar/home.png',
|
|
|
|
|
+ 'selectedIconPath' => self::$base_url . 'image/tabbar/home_active.png',
|
|
|
],
|
|
],
|
|
|
[
|
|
[
|
|
|
'index' => 1,
|
|
'index' => 1,
|
|
|
'text' => '分类',
|
|
'text' => '分类',
|
|
|
- 'iconPath' => self::$base_url .'image/tabbar/category.png',
|
|
|
|
|
- 'selectedIconPath' => self::$base_url .'image/tabbar/category_active.png',
|
|
|
|
|
|
|
+ 'iconPath' => self::$base_url . 'image/tabbar/category.png',
|
|
|
|
|
+ 'selectedIconPath' => self::$base_url . 'image/tabbar/category_active.png',
|
|
|
],
|
|
],
|
|
|
[
|
|
[
|
|
|
'index' => 2,
|
|
'index' => 2,
|
|
|
'text' => '店铺',
|
|
'text' => '店铺',
|
|
|
- 'iconPath' => self::$base_url .'image/tabbar/shop.png',
|
|
|
|
|
- 'selectedIconPath' => self::$base_url .'image/tabbar/shop_active.png',
|
|
|
|
|
|
|
+ 'iconPath' => self::$base_url . 'image/tabbar/shop.png',
|
|
|
|
|
+ 'selectedIconPath' => self::$base_url . 'image/tabbar/shop_active.png',
|
|
|
],
|
|
],
|
|
|
[
|
|
[
|
|
|
'index' => 3,
|
|
'index' => 3,
|
|
|
'text' => '购物车',
|
|
'text' => '购物车',
|
|
|
- 'iconPath' => self::$base_url .'image/tabbar/cart.png',
|
|
|
|
|
- 'selectedIconPath' => self::$base_url .'image/tabbar/cart_active.png',
|
|
|
|
|
|
|
+ 'iconPath' => self::$base_url . 'image/tabbar/cart.png',
|
|
|
|
|
+ 'selectedIconPath' => self::$base_url . 'image/tabbar/cart_active.png',
|
|
|
],
|
|
],
|
|
|
[
|
|
[
|
|
|
'index' => 4,
|
|
'index' => 4,
|
|
|
'text' => '我的',
|
|
'text' => '我的',
|
|
|
- 'iconPath' => self::$base_url .'image/tabbar/user.png',
|
|
|
|
|
- 'selectedIconPath' => self::$base_url .'image/tabbar/user_active.png',
|
|
|
|
|
|
|
+ 'iconPath' => self::$base_url . 'image/tabbar/user.png',
|
|
|
|
|
+ 'selectedIconPath' => self::$base_url . 'image/tabbar/user_active.png',
|
|
|
],
|
|
],
|
|
|
[
|
|
[
|
|
|
'index' => 5,
|
|
'index' => 5,
|
|
|
'text' => '订单',
|
|
'text' => '订单',
|
|
|
- 'iconPath' => self::$base_url .'image/tabbar/order.png',
|
|
|
|
|
- 'selectedIconPath' => self::$base_url .'image/tabbar/order_active.png',
|
|
|
|
|
|
|
+ 'iconPath' => self::$base_url . 'image/tabbar/order.png',
|
|
|
|
|
+ 'selectedIconPath' => self::$base_url . 'image/tabbar/order_active.png',
|
|
|
],
|
|
],
|
|
|
]
|
|
]
|
|
|
]
|
|
]
|