Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
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
chenchuanwen
my-yaf-project
Commits
f0c7e6db
Commit
f0c7e6db
authored
Oct 24, 2018
by
liuyuzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
配送公式修改
parent
7e9bf06e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
4 deletions
+12
-4
GoodsClassImage.php
application/models/DAO/Adv/GoodsClassImage.php
+1
-0
DeliveryFormula.php
application/models/DAO/DeliveryFormula.php
+11
-4
No files found.
application/models/DAO/Adv/GoodsClassImage.php
View file @
f0c7e6db
...
...
@@ -38,6 +38,7 @@ class GoodsClassImageModel extends \DAO\AbstractModel{
}
$where
[
'store_id'
]
=
$storeId
;
$where
[
'gc_id'
]
=
$gcId
;
$where
[
'state'
]
=
\Our\ApiConst
::
one
;
$goodsClassImage
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db9\GoodsClassImageRedisModel
::
getInstance
(),
array
(
&
$this
,
'find'
),
array
(
$where
),
\Our\ApiConst
::
oneHour
,
array
(
$gcId
.
'_'
.
$storeId
));
return
$goodsClassImage
;
...
...
application/models/DAO/DeliveryFormula.php
View file @
f0c7e6db
...
...
@@ -36,7 +36,7 @@ class DeliveryFormulaModel extends \DAO\AbstractModel {
if
(
!
$deliveryFormula
){
return
false
;
}
$deliveryFormula
[
'state'
]
==
1
?
$formula
=
unserialize
(
$deliveryFormula
[
'formula'
])
:
$formula
=
unserialize
(
$deliveryFormula
[
'simple_formula'
]);
/*
$deliveryFormula['state'] == 1 ? $formula = unserialize($deliveryFormula['formula']) : $formula = unserialize($deliveryFormula['simple_formula']);
if($deliveryFormula['state'] == 1){
ksort($formula);
foreach($formula as $key=>$temp){
...
...
@@ -50,6 +50,12 @@ class DeliveryFormulaModel extends \DAO\AbstractModel {
return $formula[$key];
}
}
}*/
$formula
=
unserialize
(
$deliveryFormula
[
'simple_formula'
]);
foreach
(
$formula
as
$key
=>
$temp
){
if
(
$key
*
1000
>=
$distince
){
return
$formula
[
$key
];
}
}
}
...
...
@@ -60,7 +66,7 @@ class DeliveryFormulaModel extends \DAO\AbstractModel {
return
false
;
}
$deliveryFormula
[
'state'
]
==
\Our\ApiConst
::
one
?
$formula
=
unserialize
(
$deliveryFormula
[
'formula'
])
:
$formula
=
unserialize
(
$deliveryFormula
[
'simple_formula'
]);
//
$formula = unserialize($deliveryFormula['formula']);
$formula
=
unserialize
(
$deliveryFormula
[
'formula'
]);
ksort
(
$formula
);
foreach
(
$formula
as
$k
=>
$v
){
if
(
$k
*
1000
>=
$distance
){
...
...
@@ -84,11 +90,12 @@ class DeliveryFormulaModel extends \DAO\AbstractModel {
}
$tommorowStartTime
=
$todayStartTime
+
\Our\ApiConst
::
oneDaySecond
;
$tommorowEndTime
=
$todayEndTime
+
\Our\ApiConst
::
oneDaySecond
;
if
(
$deliveryFormula
[
'state'
]
==
\Our\ApiConst
::
one
)
{
/*
if($deliveryFormula['state'] == \Our\ApiConst::one) {
$returnData = $this->getCommonFormula($choosedData,$todayStartTime,$todayEndTime,$tommorowStartTime,$tommorowEndTime,$deliveryIntval);
}else{
$returnData = $this->getSimpleFormula($choosedData,$todayStartTime,$todayEndTime,$tommorowStartTime,$tommorowEndTime,$deliveryIntval);
}
}*/
$returnData
=
$this
->
getSimpleFormula
(
$choosedData
,
$todayStartTime
,
$todayEndTime
,
$tommorowStartTime
,
$tommorowEndTime
,
$deliveryIntval
);
if
(
$deliveryFreeFlag
&&
$returnData
){
$aRplaceMent
=
array_fill
(
0
,
count
(
$returnData
),
array
(
'price'
=>
0
));
$returnData
=
array_replace_recursive
(
$returnData
,
$aRplaceMent
);
...
...
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