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
ce27e9dc
Commit
ce27e9dc
authored
Sep 23, 2021
by
suntengda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 拼单小程序活动列表新版接口 获取活动运营配置接口
parent
4ebddeaf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
0 deletions
+83
-0
Marketing.php
application/modules/Marketing/controllers/Marketing.php
+27
-0
MarketingService.php
application/services/marketing/MarketingService.php
+56
-0
No files found.
application/modules/Marketing/controllers/Marketing.php
View file @
ce27e9dc
<?php
<?php
use
App\Base\Base
;
use
App\Base\Base
;
use
App\Models\marketing\mysql\Marketing
;
use
App\Services\marketing\MarketingService
;
use
App\Services\marketing\MarketingService
;
use
App\Exception\custom\MarketingException
;
use
App\Exception\custom\MarketingException
;
use
App\Services\marketing\MarketingGoodsService
;
use
App\Services\marketing\MarketingGoodsService
;
...
@@ -256,4 +257,30 @@ class MarketingController extends Base
...
@@ -256,4 +257,30 @@ class MarketingController extends Base
$res
=
$redis
->
set
(
$key
,
$cvVersion
);
$res
=
$redis
->
set
(
$key
,
$cvVersion
);
$this
->
success
([
'result'
=>
$res
]);
$this
->
success
([
'result'
=>
$res
]);
}
}
public
function
get_operate_configAction
()
{
$userId
=
$this
->
params
[
'user_id'
]
??
0
;
$res
=
MarketingService
::
getMarketingOperateConfig
(
$userId
);
$this
->
success
([
'result'
=>
$res
]);
}
/**
* 查询活动是否在线 1在线 0不在线
* @throws \App\Exception\custom\ParamException
*/
public
function
is_onlineAction
()
{
(
new
MarketingInfoValidate
())
->
validate
();
$marketingId
=
$this
->
params
[
'marketing_id'
];
$status
=
MarketingService
::
getStatusByMarketingIds
(
$marketingId
);
if
(
isset
(
$status
[
$marketingId
])
&&
$status
[
$marketingId
][
'online_status'
]
==
Marketing
::
ONLINE_STATUS_QIDONG
)
{
$result
=
1
;
}
else
{
$result
=
0
;
}
$this
->
success
([
'result'
=>
$result
]);
}
}
}
\ No newline at end of file
application/services/marketing/MarketingService.php
View file @
ce27e9dc
...
@@ -1543,4 +1543,60 @@ class MarketingService
...
@@ -1543,4 +1543,60 @@ class MarketingService
}
}
return
$data
;
return
$data
;
}
}
//获取活动运营位配置-广场页
public
static
function
getMarketingOperateConfig
(
$userId
)
{
//获取裂变和团长分销活动状态
$fissionMarketingId
=
config
(
'marketing'
,
'fission_marketing_id'
);
$colonelMarketingId
=
config
(
'marketing'
,
'colonel_marketing_id'
);
$marketingIds
=
[
$fissionMarketingId
,
$colonelMarketingId
];
$status
=
self
::
getStatusByMarketingIds
(
$marketingIds
);
if
(
isset
(
$status
[
$fissionMarketingId
])
&&
$status
[
$fissionMarketingId
][
'online_status'
]
==
Marketing
::
ONLINE_STATUS_QIDONG
)
{
//裂变活动
$config
[
0
]
=
[
'text'
=>
'裂变活动'
,
'img'
=>
'https://si1.go2yd.com/get-image/0tzV7NKSaKT'
,
'link_url'
=>
'/pages/order/couponList?action=1'
];
}
if
(
isset
(
$status
[
$colonelMarketingId
])
&&
$status
[
$colonelMarketingId
][
'online_status'
]
==
Marketing
::
ONLINE_STATUS_QIDONG
)
{
//团长分销
$config
[
1
]
=
[
'text'
=>
'团长分销'
,
'img'
=>
'https://si1.go2yd.com/get-image/0tzV3wUuFXy'
];
}
//查询用户申请团长分销的状态,填充团长分销跳转链接
$userId
&&
$applyInfo
=
ColonelService
::
isApply
(
$userId
);
$applyStatus
=
$applyInfo
[
'apply_status'
]
??
-
1
;
// -1.未申请 0.未审核 1.审核通过 2.审核未通过
//不同状态跳转不同链接
switch
(
$applyStatus
)
{
case
0
:
case
2
:
$config
[
1
][
'link_url'
]
=
'/page-promo/promo/teamLeader/applySuccess'
;
break
;
case
1
:
$config
[
1
][
'link_url'
]
=
'/page-promo/promo/index'
;
break
;
case
-
1
:
default
:
$config
[
1
][
'link_url'
]
=
'/page-promo/promo/teamLeader/apply'
;
break
;
}
return
$config
;
}
/**
* 获取活动的在线状态
* @param $marketingIds
* @return array
*/
public
static
function
getStatusByMarketingIds
(
$marketingIds
)
{
$marketingInfo
=
Marketing
::
select
([
'marketing_id'
,
'online_status'
],[
'marketing_id'
=>
$marketingIds
]);
if
(
empty
(
$marketingInfo
))
{
return
[];
}
return
array_column
(
$marketingInfo
,
null
,
'marketing_id'
);
}
}
}
\ No newline at end of file
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