Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
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
bp
goods
Commits
0bff98bc
Commit
0bff98bc
authored
Sep 02, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test' of
https://gitlab.yidian-inc.com/bp/goods
into test
parents
68ca9988
385ffe46
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
43 additions
and
38 deletions
+43
-38
Marketing.php
application/models/marketing/mysql/Marketing.php
+14
-0
Colonelorder.php
application/modules/Job/controllers/Colonelorder.php
+1
-6
Colonelwallet.php
application/modules/Job/controllers/Colonelwallet.php
+1
-6
Marketing.php
application/modules/Marketing/controllers/Marketing.php
+2
-0
GoodsService.php
application/services/goods/GoodsService.php
+0
-12
MarketingPindanGoodsService.php
application/services/goods/MarketingPindanGoodsService.php
+0
-11
ColonelService.php
application/services/marketing/ColonelService.php
+1
-1
MarketingService.php
application/services/marketing/MarketingService.php
+17
-1
PindanActivityColonelConfigService.php
...services/marketing/PindanActivityColonelConfigService.php
+7
-1
No files found.
application/models/marketing/mysql/Marketing.php
View file @
0bff98bc
...
...
@@ -133,4 +133,18 @@ class Marketing extends MysqlBase
return
$data
;
}
/**
* 判断活动是否在进行中
* @param $marketingId
* @return bool
*/
public
static
function
isGoing
(
$marketingId
)
{
if
(
empty
(
$marketingId
))
{
return
false
;
}
$marketing
=
self
::
getRecord
([
"marketing_id"
=>
$marketingId
]);
return
!
empty
(
$marketing
)
&&
$marketing
[
"online_status"
]
==
self
::
ONLINE_STATUS_QIDONG
;
}
}
application/modules/Job/controllers/Colonelorder.php
View file @
0bff98bc
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/31 1:36 下午
*/
use
App\Base\Job
;
use
Api\PhpServices\Idgen\Idgen
;
...
...
@@ -16,7 +11,7 @@ use App\Exception\custom\InterfaceException;
use
Api\PhpUtils\Http\HttpUtil
;
use
App\Models\user\mysql\UserWechatBind
;
class
Colonel
O
rderController
extends
Job
class
Colonel
o
rderController
extends
Job
{
const
DEFAULT_USER_BATCH_SIZE
=
100
;
...
...
application/modules/Job/controllers/Colonelwallet.php
View file @
0bff98bc
<?php
/**
* Created by PhpStorm.
* User: pengfei@yidian-inc.com
* Date: 2021/8/31 2:28 下午
*/
use
App\Base\Job
;
use
Api\PhpUtils\Log\FileLog
;
...
...
@@ -11,7 +6,7 @@ use App\Models\marketing\mysql\ColonelDistributorPayInfo;
use
App\Exception\custom\InterfaceException
;
use
Api\PhpUtils\Http\HttpUtil
;
class
Colonel
W
alletController
extends
Job
class
Colonel
w
alletController
extends
Job
{
public
function
indexAction
()
{
...
...
application/modules/Marketing/controllers/Marketing.php
View file @
0bff98bc
...
...
@@ -212,6 +212,7 @@ class MarketingController extends Base
$this
->
params
[
'sort_field'
]
=
'end_time'
;
$this
->
params
[
'sort_type'
]
=
'desc'
;
$this
->
params
[
'need_buy_num'
]
=
false
;
$this
->
params
[
'online_status'
]
=
[
Marketing
::
ONLINE_STATUS_QIDONG
,
Marketing
::
ONLINE_STATUS_GUANBI
];
//状态 , 1启用,2关闭,3 到期
$this
->
params
[
'activity_status'
]
=
MarketingPindan
::
ACTIVITY_STATUS_FINISHED
;
//1 未开始,2进行中,3已结束, 4当日上新(即将开始)
$list
[
'end'
]
=
MarketingService
::
marketingList
(
$this
->
params
)[
'result'
];
$list
[
'end'
]
=
$list
[
'end'
]
?
array_column
(
$list
[
'end'
],
null
,
'marketing_id'
)
:
[];
...
...
@@ -236,6 +237,7 @@ class MarketingController extends Base
$listPart
=
array_values
(
$listPart
);
}
unset
(
$listPart
);
$list
[
'life_account_id'
]
=
MarketingService
::
getPublicLifeAccountId
();
$this
->
success
([
'result'
=>
$list
]);
}
...
...
application/services/goods/GoodsService.php
View file @
0bff98bc
...
...
@@ -157,11 +157,6 @@ class GoodsService
throw
new
GoodsException
([
'cus'
=>
2
]);
}
$spuId
=
$res
[
0
];
$checkName
=
self
::
checkGoodsName
(
$spuData
[
"goods_name"
],
$spuData
[
"life_account_id"
]);
if
(
!
$checkName
[
"can_use"
])
{
throw
new
GoodsException
([
'cus'
=>
17
]);
}
$spuParams
=
[
"goods_spu_id"
=>
$spuId
,
"shop_id"
=>
$shopId
,
...
...
@@ -771,13 +766,6 @@ class GoodsService
*/
private
static
function
editGoodsSpu
(
$goodsSpu
,
$params
=
[])
{
$checkName
=
self
::
checkGoodsName
(
$params
[
"goods_name"
],
$goodsSpu
[
"life_account_id"
],
$goodsSpu
[
"goods_spu_id"
]);
if
(
!
$checkName
[
"can_use"
])
{
throw
new
GoodsException
([
'cus'
=>
17
]);
}
return
GoodsSpu
::
save
([
"goods_name"
=>
$params
[
"goods_name"
],
"desc_pic_url"
=>
$params
[
"desc_pic_url"
],
...
...
application/services/goods/MarketingPindanGoodsService.php
View file @
0bff98bc
...
...
@@ -165,12 +165,6 @@ class MarketingPindanGoodsService
*/
private
static
function
addGoodsSku
(
$spuData
,
$shopId
,
$skuData
=
[])
{
$pindanSku
=
PindanGoodsSku
::
get
(
"goods_sku_id"
,
[
"goods_name"
=>
$skuData
[
"goods_name"
]
,
"life_account_id"
=>
$skuData
[
"life_account_id"
]]);
if
(
!
empty
(
$pindanSku
))
{
throw
new
GoodsException
([
'cus'
=>
17
]);
}
$res
=
GoodsService
::
getIdgenId
(
substr
(
$shopId
,
-
2
),
"goods"
);
if
(
empty
(
$res
))
{
throw
new
GoodsException
([
'cus'
=>
2
]);
...
...
@@ -267,11 +261,6 @@ class MarketingPindanGoodsService
*/
private
static
function
editGoodsSpu
(
$goodsSpu
,
$params
=
[])
{
$checkName
=
GoodsService
::
checkGoodsName
(
$params
[
"goods_name"
],
$goodsSpu
[
"life_account_id"
],
$goodsSpu
[
"goods_spu_id"
]);
if
(
!
$checkName
[
"can_use"
])
{
throw
new
GoodsException
([
'cus'
=>
17
]);
}
return
GoodsSpu
::
save
([
"desc_pic_url"
=>
$params
[
"desc_pic_url"
],
"desc"
=>
$params
[
"desc"
],
...
...
application/services/marketing/ColonelService.php
View file @
0bff98bc
...
...
@@ -95,7 +95,7 @@ class ColonelService
// take_place_status 是否可以添加自提点 - 已审核通过并且未添加过自提点
$applyVal
[
'take_place_status'
]
=
2
;
if
(
$applyVal
[
'audit_status'
]
==
ColonelDistributorColonelApply
::
STATUS_PASS
)
{
if
(
empty
(
$takePlaceMap
[
$applyVal
[
'colonel_apply_id'
]]
[
'take_place_id'
]
))
{
if
(
empty
(
$takePlaceMap
[
$applyVal
[
'colonel_apply_id'
]]))
{
$applyVal
[
'take_place_status'
]
=
1
;
}
}
...
...
application/services/marketing/MarketingService.php
View file @
0bff98bc
...
...
@@ -332,7 +332,11 @@ class MarketingService
$marketingIds
[]
=
$value
[
"marketing_id"
];
}
//参与人数:当前拼单成功支付的订单总数量
$userCount
=
self
::
getHaveBuyGoodsUserCount
([
"marketing_id"
=>
$marketingIds
]);
if
(
isset
(
$params
[
'need_buy_num'
])
&&
$params
[
'need_buy_num'
])
{
$userCount
=
self
::
getHaveBuyGoodsUserCount
([
"marketing_id"
=>
$marketingIds
]);
}
else
{
$userCount
=
[];
}
$marketingPindanData
=
MarketingPindan
::
select
([
"marketing_id"
,
"publish_life_account_id"
,
"min_price"
,
"max_price"
,
"pindan_desc"
,
"participate_number"
,
"pindan_pic"
]
...
...
@@ -1008,6 +1012,16 @@ class MarketingService
return
$info
;
}
/**
* 获取生活号加入生活圈天数
* @param $createTime
* @return false|float
*/
private
static
function
countAccountRegisterDays
(
$createTime
)
{
return
ceil
((
time
()
-
strtotime
(
$createTime
))
/
86400
);
}
/**
* 拼单活动详情
* @param $params
...
...
@@ -1038,7 +1052,9 @@ class MarketingService
if
(
!
empty
(
$lifeAccountList
[
$pindanMarketing
[
"publish_life_account_id"
]]))
{
$marketingData
[
"life_account_name"
]
=
$lifeAccountList
[
$pindanMarketing
[
"publish_life_account_id"
]][
"life_account_name"
];
$marketingData
[
"life_account_icon"
]
=
$lifeAccountList
[
$pindanMarketing
[
"publish_life_account_id"
]][
"life_account_icon"
];
$marketingData
[
"life_account_register_days"
]
=
self
::
countAccountRegisterDays
(
$lifeAccountList
[
$pindanMarketing
[
"publish_life_account_id"
]][
'create_time'
]);
}
$marketingData
[
"id"
]
=
$marketingInfo
[
"marketing_id"
];
$marketingData
[
"marketing_name"
]
=
$marketingInfo
[
"marketing_name"
];
$marketingData
[
"good_count"
]
=
$marketingInfo
[
"good_count"
];
...
...
application/services/marketing/PindanActivityColonelConfigService.php
View file @
0bff98bc
...
...
@@ -74,6 +74,7 @@ class PindanActivityColonelConfigService
if
(
!
empty
(
$config
))
{
$configData
=
json_decode
(
$config
[
"data"
],
true
);
foreach
(
$configData
as
$key
=>
$item
)
{
$data
[
$key
][
"marketing_id"
]
=
$config
[
"marketing_id"
];
$data
[
$key
][
"date"
]
=
$config
[
"date"
];
$data
[
$key
][
"level"
]
=
$item
[
"level"
];
$data
[
$key
][
"assess_order_num"
]
=
$item
[
"assess_order_num"
];
...
...
@@ -101,6 +102,12 @@ class PindanActivityColonelConfigService
$date
=
date
(
"Y-m-d"
);
}
$configList
=
self
::
colonelConfig
([
"date"
=>
$date
,
"type"
=>
ColonelDistributorConfig
::
TYPE_COLONEL
]);
$marketingId
=
empty
(
$configList
[
0
][
"marketing_id"
])
?
0
:
$configList
[
0
][
"marketing_id"
];
if
(
!
Marketing
::
isGoing
(
$marketingId
))
{
return
[
"number"
=>
0
,
'list'
=>
[]];
}
$num
=
0
;
if
(
!
empty
(
$params
[
"user_id"
]))
{
$inviteOrderNumRes
=
ColonelDistributorInviteOrderNum
::
getRecord
([
...
...
@@ -110,7 +117,6 @@ class PindanActivityColonelConfigService
$num
=
empty
(
$inviteOrderNumRes
[
"num"
])
?
0
:
$inviteOrderNumRes
[
"num"
];
}
$configList
=
self
::
colonelConfig
([
"date"
=>
$date
,
"type"
=>
ColonelDistributorConfig
::
TYPE_COLONEL
]);
if
(
!
empty
(
$configList
))
{
foreach
(
$configList
as
$key
=>
$config
)
{
$configList
[
$key
][
"is_finish"
]
=
0
;
...
...
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