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
9f78bc86
Commit
9f78bc86
authored
Dec 02, 2019
by
孙磊
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
模板
Signed-off-by:
sunlei
<
sunlei@romens.cn
>
parent
d003cdbc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
118 deletions
+39
-118
ShopCityDistributionRegion.php
backend/models/v1/branch/ShopCityDistributionRegion.php
+39
-0
CityDistributionRegion.php
backend/models/v1/transport/CityDistributionRegion.php
+0
-118
branch_service_type_import.xls
template/branch_service_type_import.xls
+0
-0
transport_initial_price_import.xls
template/transport_initial_price_import.xls
+0
-0
No files found.
backend/models/v1/branch/ShopCityDistributionRegion.php
View file @
9f78bc86
...
...
@@ -4,6 +4,7 @@ namespace app\models\v1\branch;
use
Yii
;
use
app\models\v1\BaseModel
;
use
app\models\v1\branch\ShopCityDistributionSetting
;
use
yii\data\ActiveDataProvider
;
/**
* This is the model class for table "shop_city_distribution_region".
...
...
@@ -44,6 +45,12 @@ class ShopCityDistributionRegion extends BaseModel
[[
'SORT'
],
'integer'
],
[[
'REGION_RANGE'
,
'COLORS'
],
'string'
],
[[
'INITIAL_PRICE'
,
'DELIVERY_PRICE'
,
'REGION_R'
],
'double'
],
[[
'GUID'
,
'REGION_RANGE'
],
'required'
,
'on'
=>
[
'create'
]],
[[
'GUID'
],
'required'
,
'on'
=>
[
'update'
]],
[[
'GUID'
,
'ORG_GUID'
,
'CITY_DISTR_GUID'
,
'ORDEX'
,
'COLORS'
,
'WEEK'
,
'IS_TYPE'
],
'string'
,
'max'
=>
50
,
'on'
=>
[
'create'
]],
[[
'GUID'
],
'unique'
,
'on'
=>
[
'create'
]],
[[
'INITIAL_PRICE'
],
'required'
,
'on'
=>
[
'import'
]
,
'message'
=>
'{attribute}不能为空'
],
];
}
...
...
@@ -75,4 +82,36 @@ class ShopCityDistributionRegion extends BaseModel
{
return
$this
->
hasOne
(
ShopCityDistributionSetting
::
className
(),
[
'GUID'
=>
'CITY_DISTR_GUID'
]);
}
//获取门店起送价
public
function
getBranchInitialPrice
(
$params
,
$guid
=
''
)
{
$query
=
static
::
find
()
->
alias
(
'sg'
)
->
select
(
"sg.GUID,cs.REGION_TYPE,cs.REGION_DISTR_DISTANCE,cs.REGION_DISTR_PRICE,cs.INCREASE_DISTANCE,
cs.INCREASE_PRICE,sg.DELIVERY_PRICE,cs.STATUS,sb.CODE,sb.NAME,sg.INITIAL_PRICE,cs.SETTING_TYPE"
)
->
leftJoin
(
'SHOP_CITY_DISTRIBUTION_SETTING cs'
,
'cs.GUID=sg.CITY_DISTR_GUID'
)
->
leftJoin
(
'SHOP_BRANCH sb'
,
'sb.GUID=cs.BRANCH_GUID'
)
->
where
([
'cs.SETTING_TYPE'
=>
2
]);
//门店名称或编码
if
(
isset
(
$params
)
&&
!
empty
(
$params
))
{
$query
->
andfilterWhere
([
'or'
,
[
'like'
,
'sb.CODE'
,
$params
[
'CODE'
]],[
'like'
,
'sb.NAME'
,
$params
[
'CODE'
]]]);
}
//批量修改 条件
if
(
isset
(
$guid
)
&&
!
empty
(
$guid
)){
$query
->
andFilterWhere
([
'='
,
'cs.BRANCH_GUID'
,
$guid
]);
$query
->
andFilterWhere
([
'!='
,
'sg.GUID'
,
''
]);
}
return
new
ActiveDataProvider
([
'query'
=>
$query
->
asArray
(),
'pagination'
=>
[
'pageSize'
=>
PAGE_SIZE
],
'sort'
=>
[
'attributes'
=>
[
'CODE'
=>
SORT_DESC
]
]
]);
}
}
backend/models/v1/transport/CityDistributionRegion.php
deleted
100644 → 0
View file @
d003cdbc
<?php
namespace
app\models\v1\transport
;
use
app\models\v1\BaseModel
;
use
Yii
;
use
yii\data\ActiveDataProvider
;
use
app\models\v1\branch\ShopCityDistributionSetting
;
/**
* This is the model class for table "shop_city_distribution_region".
*
* @property string $GUID 电子围栏GUID
* @property string $ORG_GUID 组织机构号
* @property string $CITY_DISTR_GUID 同城配送设置表,关联CITY_DISTRIBUTION_SETTING表GUID
* @property string $ORDEX 区域序号
* @property string $COLORS 区域颜色
* @property int $HF_TYPE 区域划分方式,1半径 2自定义
* @property string $REGION_R 划分方式为半径,存半径的值
* @property string $REGION_RANGE 划分方式自定义时,存数组值
* @property float $QS_PRICE 起送价格
* @property float $PS_PRICE 配送价格
* @property string|null $WEEK 配送时间周*
* @property string|null $IS_TYPE 配送时段和区域,QY为区域,SJ为时间,QS_PRICE和PS_PRICE为起始时间字段
*
* @property ShopCityDistributionSetting $cITYDISTRGU
*/
class
CityDistributionRegion
extends
BaseModel
{
/**
* {@inheritdoc}
*/
public
static
function
tableName
()
{
return
'shop_city_distribution_region'
;
}
/**
* {@inheritdoc}
*/
public
function
rules
()
{
return
[
[[
'GUID'
,
'REGION_RANGE'
],
'required'
,
'on'
=>
[
'create'
]],
[[
'GUID'
],
'required'
,
'on'
=>
[
'update'
]],
[[
'HF_TYPE'
],
'integer'
],
[[
'REGION_RANGE'
],
'string'
],
[[
'QS_PRICE'
,
'PS_PRICE'
],
'number'
],
[[
'GUID'
,
'ORG_GUID'
,
'CITY_DISTR_GUID'
,
'ORDEX'
,
'COLORS'
,
'WEEK'
,
'IS_TYPE'
],
'string'
,
'max'
=>
50
,
'on'
=>
[
'create'
]],
[[
'REGION_R'
],
'string'
,
'max'
=>
20
],
[[
'GUID'
],
'unique'
,
'on'
=>
[
'create'
]],
[[
'CITY_DISTR_GUID'
],
'exist'
,
'skipOnError'
=>
true
,
'targetClass'
=>
ShopCityDistributionSetting
::
className
(),
'targetAttribute'
=>
[
'CITY_DISTR_GUID'
=>
'GUID'
]],
[[
'QS_PRICE'
],
'required'
,
'on'
=>
[
'import'
]
,
'message'
=>
'{attribute}不能为空'
],
];
}
/**
* {@inheritdoc}
*/
public
function
attributeLabels
()
{
return
[
'GUID'
=>
'Guid'
,
'ORG_GUID'
=>
'Org Guid'
,
'CITY_DISTR_GUID'
=>
'City Distr Guid'
,
'ORDEX'
=>
'Ordex'
,
'COLORS'
=>
'Colors'
,
'HF_TYPE'
=>
'Hf Type'
,
'REGION_R'
=>
'Region R'
,
'REGION_RANGE'
=>
'Region Range'
,
'QS_PRICE'
=>
'Qs Price'
,
'PS_PRICE'
=>
'Ps Price'
,
'WEEK'
=>
'Week'
,
'IS_TYPE'
=>
'Is Type'
,
];
}
/**
* @return \yii\db\ActiveQuery
*/
public
function
getCITYDISTRGU
()
{
return
$this
->
hasOne
(
ShopCityDistributionSetting
::
className
(),
[
'GUID'
=>
'CITY_DISTR_GUID'
]);
}
//获取门店起送价
public
function
getBranchInitialPrice
(
$params
,
$guid
=
''
)
{
$query
=
static
::
find
()
->
alias
(
'sg'
)
->
select
(
"sg.GUID,cs.REGION_TYPE,cs.REGION_DISTR_DISTANCE,cs.REGION_DISTR_PRICE,cs.INCREASE_DISTANCE,
cs.INCREASE_PRICE,sg.PS_PRICE,cs.STATUS,sb.CODE,sb.NAME,sg.QS_PRICE,cs.SETTING_TYPE"
)
->
leftJoin
(
'SHOP_CITY_DISTRIBUTION_SETTING cs'
,
'cs.GUID=sg.CITY_DISTR_GUID'
)
->
leftJoin
(
'SHOP_BRANCH sb'
,
'sb.GUID=cs.BRANCH_GUID'
)
->
where
([
'cs.SETTING_TYPE'
=>
2
]);
//门店名称或编码
if
(
isset
(
$params
)
&&
!
empty
(
$params
))
{
$query
->
andfilterWhere
([
'or'
,
[
'like'
,
'sb.CODE'
,
$params
[
'CODE'
]],[
'like'
,
'sb.NAME'
,
$params
[
'CODE'
]]]);
}
//批量修改 条件
if
(
isset
(
$guid
)
&&
!
empty
(
$guid
)){
$query
->
andFilterWhere
([
'='
,
'cs.BRANCH_GUID'
,
$guid
]);
$query
->
andFilterWhere
([
'!='
,
'sg.GUID'
,
''
]);
}
// return $query->createCommand()->getSql();
return
new
ActiveDataProvider
([
'query'
=>
$query
->
asArray
(),
'pagination'
=>
[
'pageSize'
=>
15
],
'sort'
=>
[
'attributes'
=>
[
'CODE'
=>
SORT_DESC
]
]
]);
}
}
\ No newline at end of file
template/branch_service_type_import.xls
0 → 100644
View file @
9f78bc86
File added
template/transport_initial_price_import.xls
0 → 100644
View file @
9f78bc86
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