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
Expand all
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
...
@@ -138,6 +138,7 @@ class ShopGoods extends BaseModel
[[
'PACKAGE_LICENSE_NUMBER'
],
'string'
,
'max'
=>
30
],
[[
'PACKAGE_LICENSE_NUMBER'
],
'string'
,
'max'
=>
30
],
[[
'CODE'
],
'unique'
],
[[
'CODE'
],
'unique'
],
[[
'GUID'
],
'unique'
],
[[
'GUID'
],
'unique'
],
[[
'CODE'
],
'required'
,
'on'
=>
[
'import'
],
'message'
=>
'{attribute}不能为空'
],
];
];
}
}
...
@@ -249,4 +250,14 @@ class ShopGoods extends BaseModel
...
@@ -249,4 +250,14 @@ class ShopGoods extends BaseModel
'IS_GIFT_INTERNET'
=>
'Is Gift Internet'
,
'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
This diff is collapsed.
Click to expand it.
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
...
@@ -70,4 +70,32 @@ class ShopGoodsBrand extends BaseModel
'PIC_EXTENSIONS'
=>
'Pic Extensions'
,
'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
...
@@ -57,11 +57,21 @@ class ShopGoodsProperty extends BaseModel
/**
/**
* 获取商品标签信息
* 获取商品标签信息
*/
*/
public
function
getGoodsProperty
(
$name
)
public
function
validateProperty
(
$all_tag
)
{
{
return
$query
=
static
::
find
()
$query
=
static
::
find
()
->
select
(
'count(GUID) as num,GUID'
)
->
select
(
'GUID,NAME'
)
->
where
([
'NAME'
=>
$name
])
->
all
();
->
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