Commit 75f13301 by 杨树贤

解决冲突

parents 325bebb9 3c1c338a
......@@ -13,53 +13,24 @@ SYSTEM_NAME=商品信息处理服务(开发环境)
LARAVELS_LISTEN_IP=0.0.0.0
LARAVELS_LISTEN_PORT=62006
//基石自营商品主库
DB_Self_HOST=192.168.1.234
DB_Self_DATABASE=liexin_data
DB_Self_USERNAME=spu
DB_Self_PASSWORD=spu
DB_Self_HOST=192.168.2.239
DB_Self_DATABASE=lc_footstone
DB_Self_USERNAME=root
DB_Self_PASSWORD=root
DB_Self_PORT=3306
DB_Self_PREFIX=lie_
//采购系统数据库
DB_PUR_HOST=192.168.2.232
DB_PUR_DATABASE=liexin_wms
DB_PUR_USERNAME=liexin_wms
DB_PUR_PASSWORD=liexin_wms#zsyM
DB_PUR_PORT=3306
DB_Pur_HOST=192.168.2.239
DB_Pur_DATABASE=lc_wms
DB_Pur_USERNAME=root
DB_Pur_PASSWORD=root
DB_Pur_PORT=3306
DB_Pur_PREFIX=lie_
//基石联营SPU数据库
DB_SPU_HOST=192.168.1.234
DB_SPU_DATABASE=liexin_spu
DB_SPU_USERNAME=spu
DB_SPU_PASSWORD=spu
DB_SPU_PORT=3306
DB_SPU_PREFIX=lie_
//基石数据库名字配置
SPU_DB_DATABASE=liexin_spu
SKU_0_DB_DATABASE=liexin_sku_0
SKU_1_DB_DATABASE=liexin_sku_1
SKU_2_DB_DATABASE=liexin_sku_2
SKU_3_DB_DATABASE=liexin_sku_3
SKU_4_DB_DATABASE=liexin_sku_4
SKU_5_DB_DATABASE=liexin_sku_5
SKU_6_DB_DATABASE=liexin_sku_6
SKU_7_DB_DATABASE=liexin_sku_7
SKU_8_DB_DATABASE=liexin_sku_8
SKU_9_DB_DATABASE=liexin_sku_9
DB_CONNECTION=mysql
DB_HOST=192.168.2.239
DB_USERNAME=root
DB_PASSWORD=root
DB_PORT=3306
DB_DATABASE=lc_footstone
DB_PREFIX=lie_
REDIS_HOST=192.168.1.235
REDIS_PASSWORD=icDb29mLy2s
REDIS_PORT=6379
......@@ -69,10 +40,5 @@ REDIS_READ_HOST=192.168.1.237
REDIS_READ_PASSWORD=icDb29mLy2s
REDIS_READ_PORT=6379
MONG_DB_SPU_ATTRS_HOST=192.168.1.237
MONG_DB_SPU_ATTRS_USERNAME=ichunt
MONG_DB_SPU_ATTRS_PASSWORD=huntmon6699
MONG_DB_SPU_ATTRS_DATABASE=ichunt
CACHE_DRIVER=file
QUEUE_DRIVER=sync
......@@ -22,22 +22,16 @@ class ServicesController extends Controller
$SkuId=$collert['goods_id'];
$Redis=new RedisModel();
$GoodsModel=new SelfGoodsModel();
$SkuModel=new SkuModel();
$SpuModel=new SpuModel();
if(is_string($SkuId) && stripos($SkuId,',')!==false) $SkuId=explode(',',$SkuId);//兼容逗号方式
$data=[];
if(is_array($SkuId)){
foreach ($SkuId as $k=>$v){
$data[$v]=false;
if(strlen($v)==19) {//联营或者专卖
$data[$v] = $SkuModel->combination($v,$collert['power'], $Redis,$SpuModel);
}else $data[$v]=$GoodsModel->WebSelfGoodsDetail($v, $collert['power'], $Redis);
$data[$v]=$GoodsModel->WebSelfGoodsDetail($v, $collert['power'], $Redis);
}
}else{
$data[$SkuId]=false;
if(strlen($SkuId)==19) {//联营或者专卖
$data[$SkuId] = $SkuModel->combination($SkuId,$collert['power'], $Redis,$SpuModel);
}else $data[$SkuId]=$GoodsModel->WebSelfGoodsDetail($SkuId, $collert['power'], $Redis);
$data[$SkuId]=$GoodsModel->WebSelfGoodsDetail($SkuId, $collert['power'], $Redis);
}
return $this->Export(0,'success',['data'=>$data]);
}
......
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class PoolBrandModel extends Model
{
protected $connection = 'spu';
protected $table = 'brand';
public $timestamps = false;
//从redis获取分类数据
public function HdCacheBrand($BrandID,$Redis=''){
if(empty($BrandID)) return false;
if(empty($Redis)) $Redis=new RedisModel();
$Find=$Redis->hget('brand',$BrandID);
if($Find) return $Find;
$Find=$this->where('brand_id','=',$BrandID)->select('brand_name')->first();
if(!$Find) return false;
$Find=$Find->toArray();
$Redis->hset('brand',$BrandID,$Find['brand_name']);
$Redis->hset('brand_name_all',md5(strtolower($Find['brand_name'])),$BrandID);
ErrorLog('',0000,'SPU品牌缓存丢失,BrandID:'.$BrandID);
return $Find['brand_name'];
}
}
\ No newline at end of file
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class PoolClassModel extends Model
{
protected $connection = 'spu';
protected $table = 'classify';
public $timestamps = false;
//从redis获取分类数据
public function HdCacheClass($ClassID,$Redis=''){
if(empty($ClassID)) return false;
if(empty($Redis)) $Redis=new RedisModel();
$Find=$Redis->hget('class',$ClassID);
if($Find) return $Find;
$Find=$this->where('class_id','=',$ClassID)->select('class_name')->first();
if(!$Find) return false;
$Find=$Find->toArray();
$Redis->hset('class',$ClassID,$Find['class_name']);
//需要记录一下日志
ErrorLog('',0000,'SPU分类缓存丢失,CLASSID:'.$ClassID);
return $Find['class_name'];
}
}
\ No newline at end of file
......@@ -5,6 +5,7 @@ namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Common\Model\RedisModel;
class SelfClassifyModel extends Model
{
......@@ -103,4 +104,14 @@ class SelfClassifyModel extends Model
return $parentClass;
}
//获取分类参数
public function getClassAttr($class_id){
$Redis = new RedisModel();
$Cache = json_decode($Redis->hget('class_attr', $class_id), true);
if(empty($Cache)){
return false;
}
return $Cache;
}
}
......@@ -16,7 +16,6 @@ class SelfGoodsModel extends Model
if(empty($SupplierModel)) $SupplierModel = new SupplierChannelModel();
if(empty($BrandModel)) $BrandModel = new SelfBrandModel();
if(empty($UnitModel)) $UnitModel = new UnitModel();
if(empty($ResourceModel)) $ResourceModel = new ResourceModel();
if(empty($ClassModel)) $ClassModel = new SelfClassifyModel();
$Find['supplier_name']=$SupplierModel->ObSupplierName($Find['supplier_id']);
......@@ -25,10 +24,6 @@ class SelfGoodsModel extends Model
$Find['goods_unit_name']=$UnitModel->OBUnitInfo($Find['goods_unit'],$Redis);
$Find['packing_name']=$UnitModel->OBUnitInfo($Find['packing'],$Redis);
$Find['mpq_unit_name']=$UnitModel->OBUnitInfoAlias($Find['packing'],$Redis);
$GoodsImages=$ResourceModel->GetResourceInfoById($Find['goods_images'],$Redis);
$Find['goods_images']=$GoodsImages;
$GoodsPdf=$ResourceModel->GetResourceInfoById($Find['pdf'],$Redis);
$Find['pdf']=$GoodsPdf;
if(!empty($Find['class_name'])) unset($Find['class_name']);
//处理库存
......@@ -57,13 +52,26 @@ class SelfGoodsModel extends Model
if(!empty($Find['class_id2'])){
$class_id2=$ClassModel->ProduceClassRedis($Find['class_id2'],false,$Redis);
empty($class_id2['class_name']) || $Find['class_id2_name']=$class_id2['class_name'];
//处理分类参数重要值
$ClassAttrCache = $ClassModel->getClassAttr($Find['class_id2']);
if($ClassAttrCache && is_array($ClassAttrCache)){
foreach ($ClassAttrCache as $k=>$v){
$ClassAttrCache[md5($v['attr_name'])] = empty($v['is_important']) ? 1 : $v['is_important'];
unset($ClassAttrCache[$k]);
}
if(!empty($Find['attrs']) && is_array($Find['attrs'])){
foreach ($Find['attrs'] as $k=>$v){
$Find['attrs'][$k]['is_important'] = empty($ClassAttrCache[md5($v['attr_name'])]) ? 1 : $ClassAttrCache[md5($v['attr_name'])];
}
}
}
}
if(is_array($Find['ladder_price'])){
$Find['ladder_price']=arraySequence($Find['ladder_price'],'purchases','SORT_ASC');
}
if($Find['status'] != 1 || !count($Find['ladder_price'])>0 || empty($Find['ladder_price'][0]['purchases'])){
$Find['is_buy']=0;
}else{
......@@ -212,7 +220,7 @@ class SelfGoodsModel extends Model
$this->connection='self';//开始连接数据库
$fieldArr=['other_attrs', 'goods_id','goods_type','supplier_id','brand_id','class_id1','class_id2','goods_name','status',
'encoded','encap','packing','goods_unit','goods_images','pdf','goods_brief','moq','mpq',
'ladder_price','update_time','sku_name','mpl','stock','attrs','cost','new_cost'];
'ladder_price','update_time','sku_name','mpl','stock','attrs','cost','new_cost','cn_delivery_time'];
$info=$this->where('goods_id','=',$goods_id)->select($fieldArr)->first();
if(!$info) return false;
$info=$info->toArray();
......
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Log;
class SkuModel extends Model
{
protected $connection=false;
protected $table=false;
public $timestamps = false;
//生成数据库连接
public function ConnectDB($SkuId){
if(strlen($SkuId)!==19) return false;
$dt = resolve($SkuId);
$this->connection=$dt['db'];
$this->table=$dt['table'];
return true;
}
public function combination($SkuID,$power =[], $Redis='',$SpuModel=''){
if(empty($Redis)) $Redis=new RedisModel();
if(empty($SpuModel)) $SpuModel=new SpuModel();
$Find=$this->HdCacheGoods($SkuID,$Redis);
if(!$Find) return false;
$Find['goods_id']=$SkuID;
//读取spu的缓存
if(strlen($Find['spu_id'])!=19) return false;
$spuinfo=$SpuModel->HdCacheSpu($Find['spu_id'],$Redis);
$spuinfo['spu_id']=$Find['spu_id'];
if(!empty($spuinfo['images_l']) && strlen($spuinfo['images_l'])<5) $spuinfo['images_l']='';
if(empty($spuinfo['pdf']) || (!empty($spuinfo['pdf']) && strlen($spuinfo['pdf'])<5)) $spuinfo['pdf']='';
if(empty($Find['goods_images']) && !empty($spuinfo['images_l'])) $Find['goods_images']=$spuinfo['images_l'];
//处理分类
if(isset($spuinfo['class_id3']) && $spuinfo['class_id3']!=0){
$PoolClassModel=new PoolClassModel();
$spuinfo['class_name']=$PoolClassModel->HdCacheClass($spuinfo['class_id3'],$Redis);
$spuinfo['class_name3']=$PoolClassModel->HdCacheClass($spuinfo['class_id3'],$Redis);
$spuinfo['class_name2']=$PoolClassModel->HdCacheClass($spuinfo['class_id2'],$Redis);
$spuinfo['class_name1']=$PoolClassModel->HdCacheClass($spuinfo['class_id1'],$Redis);
}else $spuinfo['class_name']='其他';
if(empty($Find['goods_name'])) $Find['goods_name']=$spuinfo['spu_name'];
$BrandModel=new PoolBrandModel();
$Find['brand_name']=$BrandModel->HdCacheBrand($spuinfo['brand_id'],$Redis);
//获取税务信息
if(!empty($Find['goods_name']) && !empty($spuinfo['brand_id'])){
$spuinfo['erp_tax']=HDErpTax($Find['goods_name'],$Find['brand_name'],$Redis);
}
$Find['supplier_name']=HdCachePoolSupplier($Find['supplier_id']);
//获取Attrs
$AttrsModel=new SpuAttrsModel();
$Find['attrs']=$AttrsModel->HdCacheAttrs($Find['spu_id']);
if(is_string($Find['attrs'])) $Find['attrs']=json_decode($Find['attrs'],true);
//处理过期
if(!empty($Find['is_expire'])) $Find['ladder_price']='';
//处理活动
$Find['ac_type']=0;
$Find['allow_coupon']=1;
$Find['brand_id']=$spuinfo['brand_id'];
$activity = false;
// $ratio=HDActivityPrice($Find,'_Discount',$Redis);//获取折扣价
// if(!empty($ratio) && is_array($ratio)) $Find=array_merge($Find,$ratio);
// else {
//判断是否有新客价权利
if(empty($activity) && !empty($power['newCustomer']) && ($power['newCustomer'] === true || $power['newCustomer'] === 'true')){
$ratio=HDActivityPrice($Find,'_NewCustomer',$Redis);//获取新客价
if(!empty($ratio) && is_array($ratio)){
$Find=array_merge($Find,$ratio);
$activity = true;//标记为已有优惠
}
}
//获取活动价
if(empty($activity)){
$ratio = HDActivityPrice($Find, '', $Redis);
if (!empty($ratio) && is_array($ratio)){
$Find = array_merge($Find, $ratio);
$activity = true;//标记为已有优惠
}
}
//获取会员价
if(empty($activity) && !empty($power['member']) && $power['member'] === true) {
$ratio = HDActivityPrice($Find, '_Member', $Redis);
if (!empty($ratio) && is_array($ratio)){
$Find = array_merge($Find, $ratio);
$activity = true;//标记为已有优惠
}
}
//处理价格
if(!empty($Find['ladder_price'])){
$Find['ladder_price']=arraySequence($Find['ladder_price'],'purchases','SORT_ASC');
$Arr=current($Find['ladder_price']);
if($Arr['purchases']>$Find['moq']) $Find['moq']=$Arr['purchases'];
}
$Coefficient=$this->HdCoefficient($Find,$Redis);//获取系数
if(!empty($Coefficient)) $Find=array_merge($Find,$Coefficient);
if(!empty($Find['ladder_price']))
$Find['ladder_price'] = array_values($Find['ladder_price']);
//获取附加费,要换算美元的
if(!empty($Find['supplier_id'])) $Find['supp_extend_fee']['cn']=HdExtendFee($Find['supplier_id']);
if($Find['supp_extend_fee']['cn']){
$Find['supp_extend_fee']['us']=$Find['supp_extend_fee']['cn'];
$Rate=$this->HdRate($Redis);
if($Rate) $Find['supp_extend_fee']['us']['price']=round($Find['supp_extend_fee']['us']['price']/$Rate,4);
}
//还要处理货期
$Delivery=HdDelivery($Find['supplier_id'],$Find['canal'],$Redis);
if(!empty($Delivery['cn_delivery'])) $Find['cn_delivery_time']=$Delivery['cn_delivery'];
if(!empty($Delivery['hk_delivery'])) $Find['hk_delivery_time']=$Delivery['hk_delivery'];
//处理是否可以购买
if(empty($Find['mpq'])) $Find['mpq']=1;
if($Find['goods_status'] !=1 || $Find['moq']>$Find['stock'] || !isset($Find['ladder_price']) || empty($Find['ladder_price']) || !count($Find['ladder_price'])>0 || $Find['stock']<1 ){
$Find['is_buy']=0;
}else $Find['is_buy']=1;
$Find=array_merge($Find,$spuinfo);
return $Find;
}
//从Redis获取数据
private function HdCacheGoods($SkuID,$Redis=''){
if(empty($SkuID)) return false;
if(empty($Redis)) $Redis=new RedisModel();
$Find=json_decode($Redis->hget('sku',$SkuID),true);
if(!$Find){//没有缓存,读取数据库
$this->ConnectDB($SkuID);
$Find=$this->where('goods_id', $SkuID)
->select('goods_id','goods_sn','spu_id','update_time','goods_status','goods_name','goods_type','supplier_id','encoded','batch_sn','moq','mpq','stock','hk_delivery_time','cn_delivery_time','goods_details','ladder_price','goods_images','canal','cp_time')
->first();
if(!$Find) return false;
$Find = $Find->toArray();
$Find['ladder_price']=json_decode($Find['ladder_price'],true);
$Redis->hset('sku',$SkuID,json_encode($Find));
//需要记录一下日志
ErrorLog(0000,'SKU缓存丢失,SKUID:'.$SkuID);
}
return $Find;
}
//获取系数
public function HdCoefficient($GoodsInfo,$Redis=''){
if(empty($GoodsInfo) || empty($GoodsInfo['ladder_price'])) return false;
if(empty($Redis)) $Redis=new RedisModel();
$flag=0;
$info['ladder_price']='';
if($GoodsInfo['supplier_id']==17){
foreach ($GoodsInfo['ladder_price'] as $kp=>$vp){
if(empty($vp['purchases'])) continue;
$data[$kp]['purchases']=$vp['purchases'];
if(!empty($vp['price_us'])) $data[$kp]['price_us']=round($vp['price_us'],4);
if(!empty($vp['price_cn'])) $data[$kp]['price_cn']=round($vp['price_cn'],4);
if(($GoodsInfo['goods_type']==1 || $GoodsInfo['goods_type']==2) && isset($GoodsInfo['ac_type']) && $GoodsInfo['ac_type']>1 && $GoodsInfo['ratio']>0){
$temp_price_ac = round($data[$kp]['price_cn']*($GoodsInfo['ratio']/100),4);
$data[$kp]['price_ac'] = $temp_price_ac;
//优惠价后等于0
if($temp_price_ac<=0) $info['ac_type'] = 0;
//价格与原价一样
if($data[$kp]['price_cn'] == $temp_price_ac && $kp<2){
$flag = $flag+1;
if($flag>=2 || !isset($data[1]['price_cn'])) $info['ac_type'] = 0;
}
}
}
}else{
$Find=json_decode($Redis->hget('pool_supplier_ratio',$GoodsInfo['supplier_id']),true);
if(!$Find){//不存在时,发出异常
$message='系数获取异常,供应商:'.$GoodsInfo['supplier_id'];
SendDingTalk($message);
ErrorLog(0000,'系数异常,SupplierID:'.$GoodsInfo['supplier_id']);
return false;
}
$coefficient = '';
//查找使用哪个系数
foreach ($Find as $k=>$v){
if($v['is_default'] == 2){
$default_coefficient = $v;
continue;
}
if(empty($v['goods_name']) && empty($v['brand_name']))
continue;
if(!empty($v['brand_name']) && false !== stripos($v['brand_name'],$GoodsInfo['brand_name'])){
$coefficient = $v;
break;
}
if(!empty($v['goods_name']) && false !== stripos($v['goods_name'],$GoodsInfo['goods_name'])){
$coefficient = $v;
break;
}
}
if(empty($coefficient) && empty($default_coefficient)){
$message='未匹配到系数,供应商:'.$GoodsInfo['supplier_id'];
SendDingTalk($message);
ErrorLog(0000,'未匹配到系数,SupplierID:'.$GoodsInfo['supplier_id']);
return false;
}
if(empty($coefficient))
$coefficient = $default_coefficient;
$tax = config('website.tax');
foreach ($GoodsInfo['ladder_price'] as $kp=>$vp){
if(empty($vp['purchases'])) continue;
$data[$kp]['purchases']=$vp['purchases'];
$data[$kp]['price_us']=round($vp['price_us']*$coefficient['extra_ratio']*$coefficient['hk'], 4);//处理美金
$data[$kp]['price_cn']=round($vp['price_us']*$coefficient['extra_ratio']*$coefficient['cn']*
$coefficient['ratio']*$tax,4);
//处理mouser的成本价
if(isset($GoodsInfo['ac_type']) && $GoodsInfo['ac_type']==2 && $GoodsInfo['supplier_id']==14){
if(!empty($vp['cost_price'])){
$data[$kp]['price_ac']=round($vp['cost_price']*$coefficient['extra_ratio']*$coefficient['cn']*
$coefficient['ratio']*$tax,4);//计算活动价
$data[$kp]['price_us']=round($vp['cost_price']*$coefficient['extra_ratio']*$coefficient['hk'],4);
unset($data[$kp]['cost_price']);
}else $data[$kp]['price_ac']=$data[$kp]['price_cn'];
continue;
}
//处理活动价与原价相同
if(($GoodsInfo['goods_type']==1 || $GoodsInfo['goods_type']==2) && isset($GoodsInfo['ac_type']) && $GoodsInfo['ac_type']>1 && $GoodsInfo['ratio']>0){
$temp_price_ac = round($data[$kp]['price_cn']*($GoodsInfo['ratio']/100),4);//活动折扣
$data[$kp]['price_ac'] = $temp_price_ac;
if($temp_price_ac<=0){
$info['ac_type'] = 0;
break;
}else{
if($GoodsInfo['ac_type']==4){
$data[$kp]['price_cn']=$temp_price_ac;
$info['ac_type']=0;
}
}
if($data[$kp]['price_cn'] == $temp_price_ac && $kp<2){
$flag = $flag+1;
if($flag>=2 || !isset($data[1]['price_cn'])) $info['ac_type'] = 0;
}
}
}
//输出税费到前端
unset($coefficient['goods_name'],$coefficient['brand_name'],$coefficient['file_url'],
$coefficient['is_default'],$coefficient['id'],$coefficient['sort']);
$coefficient['tax'] = $tax;
$info['coefficient'] = $coefficient;
}
$info['original_price'] = $GoodsInfo['ladder_price'];
if(!empty($data)) $info['ladder_price']=$data;
return $info;
}
public function HdRate($Redis=''){
$Find=json_decode($Redis->hget('SUPPLIER_REDIS_INFO_',8),true);
if(!$Find) return false;
$coefficient = current($Find['price_json']);
return $coefficient['rate'];
}
}
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
use DB;
class SpuAttrsModel extends Model
{
protected $connection = 'mongodb';
protected $table = 'spu_attrs';
public $timestamps = false;
public function HdCacheAttrs($SpuID){
$Find=DB::connection('mongodb')->table('spu_attrs')->where('spu_id','=',(int)$SpuID)->select('attrs')->first();
if(!$Find) return false;
$info=json_decode($Find['attrs'],true);
if(!$info) return false;
$Attrs=false;
foreach ($info as $k=>$v){
$Attrs[]=[
'attr_name'=>$k,
'attr_value'=>$v
];
}
return $Attrs;
}
}
\ No newline at end of file
<?php
namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class SpuModel extends Model
{
protected $connection = false;
protected $table = false;
public $timestamps = false;
//生成数据库连接
public function ConnectDB($SpuId)
{
if (strlen($SpuId) !== 19) return false;
$dt = resolve($SpuId);
$this->connection = $dt['db'];
$this->table = $dt['table'];
return true;
}
//从redis获取spu数据
public function HdCacheSpu($SpuID,$Redis=''){
if(empty($SpuID)) return false;
if(empty($Redis)) $Redis=new RedisModel();
$Find=json_decode($Redis->hget('spu',$SpuID),true);
if($Find) return $Find;
$this->ConnectDB($SpuID);
$Find=$this->where('spu_id',$SpuID)
->select('spu_id','class_id1','class_id2','class_id3','spu_name','brand_id','status','update_time','images_l','encap','pdf','spu_brief','attrs','spu_detail')
->first();
if(!$Find) return false;
$Find=$Find->toArray();
$Find['attrs']=json_decode($Find['attrs'],true);
//更新redis
$Redis->hset('spu',$SpuID,json_encode($Find));
//需要记录一下日志
ErrorLog('',0000,'SPU缓存丢失,SPUID:'.$SpuID);
return $Find;
}
}
\ No newline at end of file
......@@ -118,182 +118,6 @@ return [
],
],
'spu'=>[
'driver' => 'mysql',
'host' => env('DB_SPU_HOST', ''),
'database' => env('DB_SPU_DATABASE', ''),
'username' => env('DB_SPU_USERNAME', ''),
'password' => env('DB_SPU_PASSWORD', ''),
'port' => env('DB_SPU_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => env('DB_SPU_PREFIX', 'lie_'),
'options' => [
// 开启持久连接
\PDO::ATTR_PERSISTENT => true,
],
],
'sku_0' => [
'driver' => 'mysql',
'database' => env('SKU_0_DB_DATABASE', ''),
'host' => env('DB_SPU_HOST', ''),
'username' => env('DB_SPU_USERNAME', ''),
'password' => env('DB_SPU_PASSWORD', ''),
'port' => env('DB_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => env('DB_SPU_PREFIX', 'lie_'),
'options' => [
// 开启持久连接
\PDO::ATTR_PERSISTENT => true,
],
],
'sku_1' => [
'driver' => 'mysql',
'database' => env('SKU_1_DB_DATABASE', ''),
'host' => env('DB_SPU_HOST', ''),
'username' => env('DB_SPU_USERNAME', ''),
'password' => env('DB_SPU_PASSWORD', ''),
'port' => env('DB_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => env('DB_SPU_PREFIX', 'lie_'),
'options' => [
// 开启持久连接
\PDO::ATTR_PERSISTENT => true,
],
],
'sku_2' => [
'driver' => 'mysql',
'database' => env('SKU_2_DB_DATABASE', ''),
'host' => env('DB_SPU_HOST', ''),
'username' => env('DB_SPU_USERNAME', ''),
'password' => env('DB_SPU_PASSWORD', ''),
'port' => env('DB_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => env('DB_SPU_PREFIX', 'lie_'),
'options' => [
// 开启持久连接
\PDO::ATTR_PERSISTENT => true,
],
],
'sku_3' => [
'driver' => 'mysql',
'database' => env('SKU_3_DB_DATABASE', ''),
'host' => env('DB_SPU_HOST', ''),
'username' => env('DB_SPU_USERNAME', ''),
'password' => env('DB_SPU_PASSWORD', ''),
'port' => env('DB_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => env('DB_SPU_PREFIX', 'lie_'),
'options' => [
// 开启持久连接
\PDO::ATTR_PERSISTENT => true,
],
],
'sku_4' => [
'driver' => 'mysql',
'database' => env('SKU_4_DB_DATABASE', ''),
'host' => env('DB_SPU_HOST', ''),
'username' => env('DB_SPU_USERNAME', ''),
'password' => env('DB_SPU_PASSWORD', ''),
'port' => env('DB_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => env('DB_SPU_PREFIX', 'lie_'),
'options' => [
// 开启持久连接
\PDO::ATTR_PERSISTENT => true,
],
],
'sku_5' => [
'driver' => 'mysql',
'database' => env('SKU_5_DB_DATABASE', ''),
'host' => env('DB_SPU_HOST', ''),
'username' => env('DB_SPU_USERNAME', ''),
'password' => env('DB_SPU_PASSWORD', ''),
'port' => env('DB_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => env('DB_SPU_PREFIX', 'lie_'),
'options' => [
// 开启持久连接
\PDO::ATTR_PERSISTENT => true,
],
],
'sku_6' => [
'driver' => 'mysql',
'database' => env('SKU_6_DB_DATABASE', ''),
'host' => env('DB_SPU_HOST', ''),
'username' => env('DB_SPU_USERNAME', ''),
'password' => env('DB_SPU_PASSWORD', ''),
'port' => env('DB_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => env('DB_SPU_PREFIX', 'lie_'),
'options' => [
// 开启持久连接
\PDO::ATTR_PERSISTENT => true,
],
],
'sku_7' => [
'driver' => 'mysql',
'database' => env('SKU_7_DB_DATABASE', ''),
'host' => env('DB_SPU_HOST', ''),
'username' => env('DB_SPU_USERNAME', ''),
'password' => env('DB_SPU_PASSWORD', ''),
'port' => env('DB_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => env('DB_SPU_PREFIX', 'lie_'),
'options' => [
// 开启持久连接
\PDO::ATTR_PERSISTENT => true,
],
],
'sku_8' => [
'driver' => 'mysql',
'database' => env('SKU_8_DB_DATABASE', ''),
'host' => env('DB_SPU_HOST', ''),
'username' => env('DB_SPU_USERNAME', ''),
'password' => env('DB_SPU_PASSWORD', ''),
'port' => env('DB_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => env('DB_SPU_PREFIX', 'lie_'),
'options' => [
// 开启持久连接
\PDO::ATTR_PERSISTENT => true,
],
],
'sku_9' => [
'driver' => 'mysql',
'database' => env('SKU_9_DB_DATABASE', ''),
'host' => env('DB_SPU_HOST', ''),
'username' => env('DB_SPU_USERNAME', ''),
'password' => env('DB_SPU_PASSWORD', ''),
'port' => env('DB_PORT', 3306),
'charset' => 'utf8',
'collation' => 'utf8_general_ci',
'prefix' => env('DB_SPU_PREFIX', 'lie_'),
'options' => [
// 开启持久连接
\PDO::ATTR_PERSISTENT => true,
],
],
'pgsql' => [
'driver' => 'pgsql',
'host' => env('DB_HOST', 'localhost'),
......@@ -343,6 +167,8 @@ return [
*/
'redis' => [
'cluster' => env('REDIS_CLUSTER', false),
'options' => [
'cluster' => env('REDIS_CLUSTER', false),
'prefix' => env('REDIS_PREFIX'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment