Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
newShopBack
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
newshop
newShopBack
Commits
bf6ae17a
Commit
bf6ae17a
authored
Dec 19, 2019
by
孙磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
商品标签、品牌、扩展信息
Signed-off-by:
sunlei
<
sunlei@romens.cn
>
parent
26c1e461
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
471 additions
and
5 deletions
+471
-5
ShopGoods.php
backend/models/v1/shopgoods/ShopGoods.php
+11
-0
ShopGoodsAttach.php
backend/models/v1/shopgoods/ShopGoodsAttach.php
+228
-0
ShopGoodsSubsidiary.php
backend/models/v1/shopgoods/ShopGoodsSubsidiary.php
+98
-0
ShopPointsGoods.php
backend/models/v1/shopgoods/ShopPointsGoods.php
+91
-0
shopGoodsBrand.php
backend/models/v1/shopgoods/shopGoodsBrand.php
+28
-0
shopGoodsProperty.php
backend/models/v1/shopgoods/shopGoodsProperty.php
+15
-5
shop_goods_extensions_import.xls
template/shop_goods_extensions_import.xls
+0
-0
shop_goods_import.xls
template/shop_goods_import.xls
+0
-0
shop_points_goods_import.xls
template/shop_points_goods_import.xls
+0
-0
No files found.
backend/models/v1/shopgoods/ShopGoods.php
View file @
bf6ae17a
...
...
@@ -138,6 +138,7 @@ class ShopGoods extends BaseModel
[[
'PACKAGE_LICENSE_NUMBER'
],
'string'
,
'max'
=>
30
],
[[
'CODE'
],
'unique'
],
[[
'GUID'
],
'unique'
],
[[
'CODE'
],
'required'
,
'on'
=>
[
'import'
],
'message'
=>
'{attribute}不能为空'
],
];
}
...
...
@@ -249,4 +250,14 @@ class ShopGoods extends BaseModel
'IS_GIFT_INTERNET'
=>
'Is Gift Internet'
,
];
}
/**
* 获取商品信息
*/
public
function
getGoodsInfo
(
$code
)
{
return
$query
=
static
::
find
()
->
select
(
'GUID,CODE,NAME'
)
->
where
([
'CODE'
=>
$code
])
->
all
();
}
}
backend/models/v1/shopgoods/ShopGoodsAttach.php
0 → 100644
View file @
bf6ae17a
<?php
namespace
app\models\v1\shopgoods
;
use
app\models\v1\BaseModel
;
use
Yii
;
use
yii\data\ActiveDataProvider
;
use
app\models\v1\branch\ShopBranch
;
use
app\models\v1\shopgoods\ShopGoods
;
/**
* This is the model class for table "shop_goods_attach".
*
* @property string $GUID
* @property string|null $ORG_GUID 组织机构号
* @property string $GOODS_GUID 商品GUID
* @property string|null $GOODS_CODE 商品编码CODE
* @property string|null $SUPCOMPANY_GUID 所属部门编号,关联SHOP_BRANCH表GUID
* @property string|null $URI 图片路径
* @property string|null $HOST_NAME 图片域名
* @property string|null $PIC_EXTENSIONS 图片后缀
* @property string|null $BAR_CODE_DOWNLOAD
* @property string|null $LEASE_BRANCH_ID
* @property string|null $ORDER_INDEX 图片序号
* @property string|null $IS_DISTRIBUTION_GOODS 是否是分销商品 1是0否
* @property string|null $EMPLOYEE_FIRST_RETURN_MONEY_RATIO 员工一级分销返利额比例
* @property string $EMPLOYEE_FIRST_RETURN_MONEY_RATIOS1 员工分销商一级返利额比例
* @property float $EMPLOYEE_FIRST_RETURN_MONEYS1 员工分销商一级返利额
* @property string $EMPLOYEE_SECOND_RETURN_MONEY_RATIOS2 员工分销商二级返利额比例
* @property float $EMPLOYEE_SECOND_RETURN_MONEYS2 员工分销商二级返利额
* @property float|null $EMPLOYEE_FIRST_RETURN_MONEY 员工一级分销返利额
* @property string|null $EMPLOYEE_SECOND_RETURN_MONEY_RATIO 员工二级分销返利额比例
* @property float|null $EMPLOYEE_SECOND_RETURN_MONEY 员工二级分销返利额
* @property string|null $USER_FIRST_RETURN_MONEY_RATIO 用户一级分销返利额比例
* @property float|null $USER_FIRST_RETURN_MONEY 用户一级分销返利额
* @property string|null $USER_SECOND_RETURN_MONEY_RATIO 用户二级分销返利额比例
* @property float|null $USER_SECOND_RETURN_MONEY 用户二级分销返利额
* @property string|null $GOODS_ABSTRACT 商品摘要
* @property string|null $GOODS_TITLE 商品标题
* @property string|null $IS_PUBLIC_MOBILE 是否发布APP或小程序 1:是 0:否
* @property string|null $IS_FOBIDEN 是否禁用,1:是
* @property string|null $DELE_NUM 0:未删除,1:放入回收站 2:从购物车删除
* @property string|null $PUBLIC_TIME 上架时间
* @property string|null $PUBLIC_TYPE 上架类型 : 1 立即上架 2定时上架 3放入仓库
* @property string|null $FOBIDEN_GUID 下架人GUID
* @property string|null $FOBIDEN_DATE 下架时间
* @property int|null $STOCK_REDUCE_TYPE 0 下单时减少库存 1 付款后减少库存
* @property string|null $TRANSPORT_TYPE 商品配送类型,配送类型之间以,隔开
* @property string|null $DETAIL_DESCRIPTION 商品介绍
* @property string|null $UPDATE_TIME 更新时间
* @property string|null $AD 广告词
* @property string|null $PREFIX 前缀
* @property string|null $HINT 温馨提示
* @property int $IS_RXANDOTC 是否双跨处方药,1:是,0:否
* @property int $IS_CARE 是否医保,1:是,0:否
* @property int $IS_GIFT 是否赠品,1:是,0:否
* @property int $IS_ACTIVITY 是否参与营销活动,1:是,0:否
* @property string|null $PAY_TYPE 支付渠道
* @property float|null $COST_PRICE 成本价
* @property float|null $CEILING_PRICE 最高限价
* @property int|null $MAX_ORDER_NUM 最大订单数量
* @property int|null $MIN_ORDER_NUM 最小订单数量
* @property string|null $GOODS_REBATE 单品级的返利维护
* @property string|null $REBATE_DISTRIBUTE 多级人员的分配
* @property int $IS_PRESELL 是否预售,1:是,0:否
* @property int $IS_LIMIT 是否限购,1:是,0:否
* @property int $IS_CROSS_BORDER 是否跨境商品,1:是,0:否
* @property string|null $TAX 商品税率/税金
* @property string|null $ESSENTIAL_DRUGS 基本药物
* @property string $STOP_SELLING 是否停销 1:是 0:否
* @property string $STOP_BUY 是否停购 1:是 0:否
* @property string|null $PUBLIC_PLATFORM 发布平台,1:一心堂小程序,2:APP,3:惠氏小程序
* @property string|null $DOWN_LEVER 是否是集团级别人员下架: 1 是
* @property string|null $DOWN_DESCRIPTION 下架原因
* @property string $GOODS_TYPE 商品类型:self:自营,third:第三方
* @property string|null $THIRD_CODE 第三方商家CODE,非第三方为空
* @property int|null $RESERVATIONS 是否可预约0不可预约 1 可预约
* @property string|null $THREE_GOODS_CODE 第三方商家商家内码
* @property int|null $CURRENCY 0 非通用 1通用(用于服务商品是否通用门店使用)
* @property float $FARE 运费
* @property string|null $AD_START_TIME 热词开始时间
* @property string|null $AD_END_TIME 热词结束时间
* @property string|null $LICENCE_SENIORITY 证照资质
* @property string|null $DC_SHOR_TAGE_DAY DC无货配送到门店XX天
* @property string|null $DC_INSTOCK_DAY DC有货,配送到门店XX天
*
* @property ShopBranch $sUPCOMPANYGU
* @property ShopGoods $gOODSGU
*/
class
ShopGoodsAttach
extends
\app\models\v1\BaseModel
{
/**
* {@inheritdoc}
*/
public
static
function
tableName
()
{
return
'shop_goods_attach'
;
}
/**
* {@inheritdoc}
*/
public
function
rules
()
{
return
[
[[
'GUID'
,
'GOODS_GUID'
],
'required'
],
[[
'EMPLOYEE_FIRST_RETURN_MONEYS1'
,
'EMPLOYEE_SECOND_RETURN_MONEYS2'
,
'EMPLOYEE_FIRST_RETURN_MONEY'
,
'EMPLOYEE_SECOND_RETURN_MONEY'
,
'USER_FIRST_RETURN_MONEY'
,
'USER_SECOND_RETURN_MONEY'
,
'COST_PRICE'
,
'CEILING_PRICE'
,
'FARE'
],
'number'
],
[[
'PUBLIC_TIME'
,
'FOBIDEN_DATE'
,
'UPDATE_TIME'
,
'AD_START_TIME'
,
'AD_END_TIME'
],
'safe'
],
[[
'STOCK_REDUCE_TYPE'
,
'IS_RXANDOTC'
,
'IS_CARE'
,
'IS_GIFT'
,
'IS_ACTIVITY'
,
'MAX_ORDER_NUM'
,
'MIN_ORDER_NUM'
,
'IS_PRESELL'
,
'IS_LIMIT'
,
'IS_CROSS_BORDER'
,
'RESERVATIONS'
,
'CURRENCY'
],
'integer'
],
[[
'DETAIL_DESCRIPTION'
,
'LICENCE_SENIORITY'
],
'string'
],
[[
'GUID'
,
'ORG_GUID'
,
'GOODS_GUID'
,
'GOODS_CODE'
,
'SUPCOMPANY_GUID'
,
'PIC_EXTENSIONS'
,
'LEASE_BRANCH_ID'
,
'FOBIDEN_GUID'
,
'PREFIX'
,
'PAY_TYPE'
,
'REBATE_DISTRIBUTE'
,
'ESSENTIAL_DRUGS'
,
'THIRD_CODE'
],
'string'
,
'max'
=>
50
],
[[
'URI'
,
'GOODS_ABSTRACT'
],
'string'
,
'max'
=>
300
],
[[
'HOST_NAME'
,
'AD'
],
'string'
,
'max'
=>
500
],
[[
'BAR_CODE_DOWNLOAD'
,
'ORDER_INDEX'
,
'DOWN_LEVER'
],
'string'
,
'max'
=>
2
],
[[
'IS_DISTRIBUTION_GOODS'
,
'IS_FOBIDEN'
,
'DELE_NUM'
],
'string'
,
'max'
=>
1
],
[[
'EMPLOYEE_FIRST_RETURN_MONEY_RATIO'
,
'EMPLOYEE_SECOND_RETURN_MONEY_RATIO'
,
'USER_FIRST_RETURN_MONEY_RATIO'
,
'USER_SECOND_RETURN_MONEY_RATIO'
],
'string'
,
'max'
=>
5
],
[[
'EMPLOYEE_FIRST_RETURN_MONEY_RATIOS1'
,
'EMPLOYEE_SECOND_RETURN_MONEY_RATIOS2'
],
'string'
,
'max'
=>
6
],
[[
'GOODS_TITLE'
,
'HINT'
],
'string'
,
'max'
=>
200
],
[[
'IS_PUBLIC_MOBILE'
,
'STOP_SELLING'
,
'STOP_BUY'
],
'string'
,
'max'
=>
3
],
[[
'PUBLIC_TYPE'
,
'GOODS_TYPE'
,
'DC_SHOR_TAGE_DAY'
,
'DC_INSTOCK_DAY'
],
'string'
,
'max'
=>
20
],
[[
'TRANSPORT_TYPE'
],
'string'
,
'max'
=>
1000
],
[[
'GOODS_REBATE'
,
'TAX'
,
'PUBLIC_PLATFORM'
],
'string'
,
'max'
=>
10
],
[[
'DOWN_DESCRIPTION'
],
'string'
,
'max'
=>
255
],
[[
'THREE_GOODS_CODE'
],
'string'
,
'max'
=>
100
],
[[
'GUID'
],
'unique'
],
[[
'GOODS_GUID'
,
'SUPCOMPANY_GUID'
],
'unique'
,
'targetAttribute'
=>
[
'GOODS_GUID'
,
'SUPCOMPANY_GUID'
]],
[[
'SUPCOMPANY_GUID'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
ShopBranch
::
className
(),
'targetAttribute'
=>
[
'SUPCOMPANY_GUID'
=>
'GUID'
]],
[[
'GOODS_GUID'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
ShopGoods
::
className
(),
'targetAttribute'
=>
[
'GOODS_GUID'
=>
'GUID'
]],
];
}
/**
* {@inheritdoc}
*/
public
function
attributeLabels
()
{
return
[
'GUID'
=>
'Guid'
,
'ORG_GUID'
=>
'Org Guid'
,
'GOODS_GUID'
=>
'Goods Guid'
,
'GOODS_CODE'
=>
'Goods Code'
,
'SUPCOMPANY_GUID'
=>
'Supcompany Guid'
,
'URI'
=>
'Uri'
,
'HOST_NAME'
=>
'Host Name'
,
'PIC_EXTENSIONS'
=>
'Pic Extensions'
,
'BAR_CODE_DOWNLOAD'
=>
'Bar Code Download'
,
'LEASE_BRANCH_ID'
=>
'Lease Branch ID'
,
'ORDER_INDEX'
=>
'Order Index'
,
'IS_DISTRIBUTION_GOODS'
=>
'Is Distribution Goods'
,
'EMPLOYEE_FIRST_RETURN_MONEY_RATIO'
=>
'Employee First Return Money Ratio'
,
'EMPLOYEE_FIRST_RETURN_MONEY_RATIOS1'
=>
'Employee First Return Money Ratios1'
,
'EMPLOYEE_FIRST_RETURN_MONEYS1'
=>
'Employee First Return Moneys1'
,
'EMPLOYEE_SECOND_RETURN_MONEY_RATIOS2'
=>
'Employee Second Return Money Ratios2'
,
'EMPLOYEE_SECOND_RETURN_MONEYS2'
=>
'Employee Second Return Moneys2'
,
'EMPLOYEE_FIRST_RETURN_MONEY'
=>
'Employee First Return Money'
,
'EMPLOYEE_SECOND_RETURN_MONEY_RATIO'
=>
'Employee Second Return Money Ratio'
,
'EMPLOYEE_SECOND_RETURN_MONEY'
=>
'Employee Second Return Money'
,
'USER_FIRST_RETURN_MONEY_RATIO'
=>
'User First Return Money Ratio'
,
'USER_FIRST_RETURN_MONEY'
=>
'User First Return Money'
,
'USER_SECOND_RETURN_MONEY_RATIO'
=>
'User Second Return Money Ratio'
,
'USER_SECOND_RETURN_MONEY'
=>
'User Second Return Money'
,
'GOODS_ABSTRACT'
=>
'Goods Abstract'
,
'GOODS_TITLE'
=>
'Goods Title'
,
'IS_PUBLIC_MOBILE'
=>
'Is Public Mobile'
,
'IS_FOBIDEN'
=>
'Is Fobiden'
,
'DELE_NUM'
=>
'Dele Num'
,
'PUBLIC_TIME'
=>
'Public Time'
,
'PUBLIC_TYPE'
=>
'Public Type'
,
'FOBIDEN_GUID'
=>
'Fobiden Guid'
,
'FOBIDEN_DATE'
=>
'Fobiden Date'
,
'STOCK_REDUCE_TYPE'
=>
'Stock Reduce Type'
,
'TRANSPORT_TYPE'
=>
'Transport Type'
,
'DETAIL_DESCRIPTION'
=>
'Detail Description'
,
'UPDATE_TIME'
=>
'Update Time'
,
'AD'
=>
'Ad'
,
'PREFIX'
=>
'Prefix'
,
'HINT'
=>
'Hint'
,
'IS_RXANDOTC'
=>
'Is Rxandotc'
,
'IS_CARE'
=>
'Is Care'
,
'IS_GIFT'
=>
'Is Gift'
,
'IS_ACTIVITY'
=>
'Is Activity'
,
'PAY_TYPE'
=>
'Pay Type'
,
'COST_PRICE'
=>
'Cost Price'
,
'CEILING_PRICE'
=>
'Ceiling Price'
,
'MAX_ORDER_NUM'
=>
'Max Order Num'
,
'MIN_ORDER_NUM'
=>
'Min Order Num'
,
'GOODS_REBATE'
=>
'Goods Rebate'
,
'REBATE_DISTRIBUTE'
=>
'Rebate Distribute'
,
'IS_PRESELL'
=>
'Is Presell'
,
'IS_LIMIT'
=>
'Is Limit'
,
'IS_CROSS_BORDER'
=>
'Is Cross Border'
,
'TAX'
=>
'Tax'
,
'ESSENTIAL_DRUGS'
=>
'Essential Drugs'
,
'STOP_SELLING'
=>
'Stop Selling'
,
'STOP_BUY'
=>
'Stop Buy'
,
'PUBLIC_PLATFORM'
=>
'Public Platform'
,
'DOWN_LEVER'
=>
'Down Lever'
,
'DOWN_DESCRIPTION'
=>
'Down Description'
,
'GOODS_TYPE'
=>
'Goods Type'
,
'THIRD_CODE'
=>
'Third Code'
,
'RESERVATIONS'
=>
'Reservations'
,
'THREE_GOODS_CODE'
=>
'Three Goods Code'
,
'CURRENCY'
=>
'Currency'
,
'FARE'
=>
'Fare'
,
'AD_START_TIME'
=>
'Ad Start Time'
,
'AD_END_TIME'
=>
'Ad End Time'
,
'LICENCE_SENIORITY'
=>
'Licence Seniority'
,
'DC_SHOR_TAGE_DAY'
=>
'Dc Shor Tage Day'
,
'DC_INSTOCK_DAY'
=>
'Dc Instock Day'
,
];
}
/**
* @return \yii\db\ActiveQuery
*/
public
function
getSUPCOMPANYGU
()
{
return
$this
->
hasOne
(
ShopBranch
::
className
(),
[
'GUID'
=>
'SUPCOMPANY_GUID'
]);
}
/**
* @return \yii\db\ActiveQuery
*/
public
function
getGOODSGU
()
{
return
$this
->
hasOne
(
ShopGoods
::
className
(),
[
'GUID'
=>
'GOODS_GUID'
]);
}
}
backend/models/v1/shopgoods/ShopGoodsSubsidiary.php
0 → 100644
View file @
bf6ae17a
<?php
namespace
app\models\v1\shopgoods
;
use
Yii
;
use
app\models\v1\BaseModel
;
/**
* This is the model class for table "shop_goods_subsidiary".
*
* @property string $GUID
* @property string|null $ORG_GUID 组织机构号
* @property string|null $GOODS_GUID 关联shop_goods表的GUID
* @property string|null $MATTERS_ATTENTION 注意事项
* @property string|null $USAGE_DOSAGE 用法用量
* @property string|null $DRUG_INIERACTIONS 药物相互作用
* @property string|null $DRUG_OVERDOSE 药物过量
* @property string|null $DRUG_INGREDIENTS 药物成分
* @property string|null $PHARMAC_TOXI 药理毒理
* @property string|null $PHARMACOKINETICS 药代动力学
* @property string|null $REMINDER 温馨提示
* @property string|null $CLINICAL_TRIALS 临床试验
* @property string|null $ELDERLY_MEDICATION 老年用药
* @property string|null $PREGLACT_MEDICATION 孕妇及哺乳期妇女用药
* @property string|null $CHILDREN_MEDICATION 儿童用药
* @property string|null $TABOO 禁忌
* @property string|null $FUNCTION_ALINDICAT 功能主治
* @property string|null $SIDE_EFFECTS 不良反应
* @property string|null $SUITABLE_CROWD 适宜人群
* @property string|null $INAPPROPRIATE_CROWD 不适宜人群
* @property string|null $MODEL 型号
* @property string|null $COLOR 颜色
* @property string|null $DIAMETER 直径
* @property string|null $THICKNESS 厚度
* @property string|null $DEGREES 度数
* @property string|null $SERVICE_INFORMATION 售后服务信息
* @property string|null $SPECIFICATION_CON 规格转化(散装)
* @property string|null $SPECIAL_PURPOSE 是否为特殊用途化妆品
*/
class
ShopGoodsSubsidiary
extends
BaseModel
{
/**
* {@inheritdoc}
*/
public
static
function
tableName
()
{
return
'shop_goods_subsidiary'
;
}
/**
* {@inheritdoc}
*/
public
function
rules
()
{
return
[
[[
'GUID'
],
'required'
],
[[
'GUID'
,
'ORG_GUID'
,
'GOODS_GUID'
,
'MATTERS_ATTENTION'
,
'USAGE_DOSAGE'
,
'DRUG_INIERACTIONS'
,
'DRUG_OVERDOSE'
,
'DRUG_INGREDIENTS'
,
'PHARMAC_TOXI'
,
'PHARMACOKINETICS'
,
'REMINDER'
,
'CLINICAL_TRIALS'
,
'ELDERLY_MEDICATION'
,
'PREGLACT_MEDICATION'
,
'CHILDREN_MEDICATION'
,
'TABOO'
,
'FUNCTION_ALINDICAT'
,
'SIDE_EFFECTS'
,
'SUITABLE_CROWD'
,
'INAPPROPRIATE_CROWD'
,
'MODEL'
,
'COLOR'
,
'DIAMETER'
,
'THICKNESS'
,
'DEGREES'
,
'SERVICE_INFORMATION'
,
'SPECIFICATION_CON'
,
'SPECIAL_PURPOSE'
],
'string'
,
'max'
=>
50
],
[[
'GUID'
],
'unique'
],
];
}
/**
* {@inheritdoc}
*/
public
function
attributeLabels
()
{
return
[
'GUID'
=>
'Guid'
,
'ORG_GUID'
=>
'Org Guid'
,
'GOODS_GUID'
=>
'Goods Guid'
,
'MATTERS_ATTENTION'
=>
'Matters Attention'
,
'USAGE_DOSAGE'
=>
'Usage Dosage'
,
'DRUG_INIERACTIONS'
=>
'Drug Inieractions'
,
'DRUG_OVERDOSE'
=>
'Drug Overdose'
,
'DRUG_INGREDIENTS'
=>
'Drug Ingredients'
,
'PHARMAC_TOXI'
=>
'Pharmac Toxi'
,
'PHARMACOKINETICS'
=>
'Pharmacokinetics'
,
'REMINDER'
=>
'Reminder'
,
'CLINICAL_TRIALS'
=>
'Clinical Trials'
,
'ELDERLY_MEDICATION'
=>
'Elderly Medication'
,
'PREGLACT_MEDICATION'
=>
'Preglact Medication'
,
'CHILDREN_MEDICATION'
=>
'Children Medication'
,
'TABOO'
=>
'Taboo'
,
'FUNCTION_ALINDICAT'
=>
'Function Alindicat'
,
'SIDE_EFFECTS'
=>
'Side Effects'
,
'SUITABLE_CROWD'
=>
'Suitable Crowd'
,
'INAPPROPRIATE_CROWD'
=>
'Inappropriate Crowd'
,
'MODEL'
=>
'Model'
,
'COLOR'
=>
'Color'
,
'DIAMETER'
=>
'Diameter'
,
'THICKNESS'
=>
'Thickness'
,
'DEGREES'
=>
'Degrees'
,
'SERVICE_INFORMATION'
=>
'Service Information'
,
'SPECIFICATION_CON'
=>
'Specification Con'
,
'SPECIAL_PURPOSE'
=>
'Special Purpose'
,
];
}
}
backend/models/v1/shopgoods/ShopPointsGoods.php
0 → 100644
View file @
bf6ae17a
<?php
namespace
app\models\v1\shopgoods
;
use
Yii
;
use
app\models\v1\BaseModel
;
/**
* This is the model class for table "shop_points_goods".
*
* @property string $GUID
* @property string|null $ORG_GUID 组织机构号
* @property string|null $GOODS_SORT_GUID 商品分类GUID
* @property string $CODE 商品编码
* @property string|null $NAME 商品名称
* @property int $VOLUME 商品销量
* @property string|null $GENERAL_IMAGE_INFO 商品主图
* @property float|null $POINTS_VALUE 全积分值
* @property float|null $PRICES 积分+现金的现金值
* @property float $PART_POINTS 积分+现金的积分值
* @property float|null $TOTAL_AMOUNT 商品总金额
* @property int|null $IS_PUBLIC_MOBILE 是否发布APP或小程序 1:是 0:否
* @property string|null $DETAIL_DESCRIPTION 商品介绍
* @property string|null $CREATE_TIME 创建时间
* @property int|null $DELE_NUM 上下架状态:0在售,1下架,2删除
* @property float|null $STOCK_COUNT 商品库存
* @property int $IS_CARE_GOODS 是否医保商品1:是
* @property int|null $EQUAL_ERP_NUM ERP数量
* @property float|null $GOODS_WEIGHT 商品重量
* @property int $IS_PROMOTE 是否电话预购:1预约
* @property string|null $SUPCOMPANY_GUID 所属省级字段
*/
class
ShopPointsGoods
extends
\app\models\v1\BaseModel
{
/**
* {@inheritdoc}
*/
public
static
function
tableName
()
{
return
'shop_points_goods'
;
}
/**
* {@inheritdoc}
*/
public
function
rules
()
{
return
[
[[
'GUID'
,
'CODE'
],
'required'
],
[[
'VOLUME'
,
'IS_PUBLIC_MOBILE'
,
'DELE_NUM'
,
'IS_CARE_GOODS'
,
'EQUAL_ERP_NUM'
,
'IS_PROMOTE'
],
'integer'
],
[[
'POINTS_VALUE'
,
'PRICES'
,
'PART_POINTS'
,
'TOTAL_AMOUNT'
,
'STOCK_COUNT'
,
'GOODS_WEIGHT'
],
'number'
],
[[
'DETAIL_DESCRIPTION'
],
'string'
],
[[
'CREATE_TIME'
],
'safe'
],
[[
'GUID'
,
'ORG_GUID'
,
'GOODS_SORT_GUID'
,
'CODE'
,
'SUPCOMPANY_GUID'
],
'string'
,
'max'
=>
50
],
[[
'NAME'
],
'string'
,
'max'
=>
100
],
[[
'GENERAL_IMAGE_INFO'
],
'string'
,
'max'
=>
200
],
[[
'GUID'
],
'unique'
],
[[
'CODE'
,
'TOTAL_AMOUNT'
],
'required'
,
'on'
=>
[
'import'
],
'message'
=>
'{attribute}不能为空'
],
];
}
/**
* {@inheritdoc}
*/
public
function
attributeLabels
()
{
return
[
'GUID'
=>
'Guid'
,
'ORG_GUID'
=>
'Org Guid'
,
'GOODS_SORT_GUID'
=>
'Goods Sort Guid'
,
'CODE'
=>
'Code'
,
'NAME'
=>
'Name'
,
'VOLUME'
=>
'Volume'
,
'GENERAL_IMAGE_INFO'
=>
'General Image Info'
,
'POINTS_VALUE'
=>
'Points Value'
,
'PRICES'
=>
'Prices'
,
'PART_POINTS'
=>
'Part Points'
,
'TOTAL_AMOUNT'
=>
'Total Amount'
,
'IS_PUBLIC_MOBILE'
=>
'Is Public Mobile'
,
'DETAIL_DESCRIPTION'
=>
'Detail Description'
,
'CREATE_TIME'
=>
'Create Time'
,
'DELE_NUM'
=>
'Dele Num'
,
'STOCK_COUNT'
=>
'Stock Count'
,
'IS_CARE_GOODS'
=>
'Is Care Goods'
,
'EQUAL_ERP_NUM'
=>
'Equal Erp Num'
,
'GOODS_WEIGHT'
=>
'Goods Weight'
,
'IS_PROMOTE'
=>
'Is Promote'
,
'SUPCOMPANY_GUID'
=>
'Supcompany Guid'
,
];
}
}
backend/models/v1/shopgoods/shopGoodsBrand.php
View file @
bf6ae17a
...
...
@@ -70,4 +70,32 @@ class ShopGoodsBrand extends BaseModel
'PIC_EXTENSIONS'
=>
'Pic Extensions'
,
];
}
/**
* 获取商品品牌是否存在
*/
public
function
validateBrand
(
$all_brand
)
{
$query
=
static
::
find
()
->
select
(
'GUID,NAME'
)
->
all
();
//获取所有品牌名
$brandsName
=
array_column
(
$query
,
'NAME'
);
$list
=
array
();
foreach
(
$all_brand
as
$key
=>
$value
)
{
if
(
!
in_array
(
$value
,
$brandsName
))
{
$list
[]
=
$value
;
}
}
return
$list
;
}
/**
* 获取商品品牌信息
*/
public
function
getBrandInfo
(
$name
)
{
return
$query
=
static
::
find
()
->
select
(
'GUID,NAME'
)
->
where
([
'NAME'
=>
$name
])
->
all
();
}
}
backend/models/v1/shopgoods/shopGoodsProperty.php
View file @
bf6ae17a
...
...
@@ -57,11 +57,21 @@ class ShopGoodsProperty extends BaseModel
/**
* 获取商品标签信息
*/
public
function
getGoodsProperty
(
$name
)
public
function
validateProperty
(
$all_tag
)
{
return
$query
=
static
::
find
()
->
select
(
'count(GUID) as num,GUID'
)
->
where
([
'NAME'
=>
$name
])
->
all
();
$query
=
static
::
find
()
->
select
(
'GUID,NAME'
)
->
all
();
//获取所有标签名
$tagsName
=
array_column
(
$query
,
'NAME'
);
$list
=
array
();
foreach
(
$all_tag
as
$key
=>
$value
)
{
foreach
(
$value
as
$k
=>
$v
)
{
if
(
!
in_array
(
$v
,
$tagsName
))
{
$list
[]
=
$v
;
}
}
}
return
$list
;
}
}
template/shop_goods_extensions_import.xls
0 → 100644
View file @
bf6ae17a
File added
template/shop_goods_import.xls
0 → 100644
View file @
bf6ae17a
File added
template/shop_points_goods_import.xls
0 → 100644
View file @
bf6ae17a
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment