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
01a82297
Commit
01a82297
authored
Jul 05, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:商品详情内团长判断
parent
037b1a0f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
2 deletions
+53
-2
GoodsService.php
application/services/goods/GoodsService.php
+36
-2
DistributorService.php
application/services/marketing/DistributorService.php
+17
-0
No files found.
application/services/goods/GoodsService.php
View file @
01a82297
...
@@ -19,8 +19,10 @@ use App\Models\goods\mysql\GoodsSnapshot;
...
@@ -19,8 +19,10 @@ use App\Models\goods\mysql\GoodsSnapshot;
use
App\Models\goods\mysql\GoodsSpu
;
use
App\Models\goods\mysql\GoodsSpu
;
use
App\Models\goods\mysql\PaySuccessGoodsCallbackRecord
;
use
App\Models\goods\mysql\PaySuccessGoodsCallbackRecord
;
use
App\Models\goods\mysql\Shop
;
use
App\Models\goods\mysql\Shop
;
use
App\Models\marketing\mysql\Distributor
;
use
App\Models\marketing\mysql\MarketingGoods
;
use
App\Models\marketing\mysql\MarketingGoods
;
use
App\Models\shop\mysql\SubShop
;
use
App\Models\shop\mysql\SubShop
;
use
App\Services\marketing\DistributorService
;
use
App\Services\marketing\MarketingGoodsService
;
use
App\Services\marketing\MarketingGoodsService
;
use
App\Services\shop\ShopService
;
use
App\Services\shop\ShopService
;
use
Api\PhpUtils\Http\Request
;
use
Api\PhpUtils\Http\Request
;
...
@@ -564,8 +566,8 @@ class GoodsService
...
@@ -564,8 +566,8 @@ class GoodsService
"goods_name"
=>
$params
[
"goods_name"
],
"goods_name"
=>
$params
[
"goods_name"
],
"desc_pic_url"
=>
$params
[
"desc_pic_url"
],
"desc_pic_url"
=>
$params
[
"desc_pic_url"
],
"desc"
=>
$params
[
"desc"
],
"desc"
=>
$params
[
"desc"
],
"introduce"
=>
$
skuData
[
"introduce"
],
"introduce"
=>
$
params
[
"introduce"
],
"introduce_pic_url"
=>
$
skuData
[
"introduce_pic_url"
],
"introduce_pic_url"
=>
$
params
[
"introduce_pic_url"
],
"expiration_time"
=>
$params
[
"expiration_time"
],
"expiration_time"
=>
$params
[
"expiration_time"
],
"rule_limit"
=>
$params
[
"rule_limit"
],
"rule_limit"
=>
$params
[
"rule_limit"
],
"rule_desc"
=>
$params
[
"rule_desc"
],
"rule_desc"
=>
$params
[
"rule_desc"
],
...
@@ -696,6 +698,22 @@ class GoodsService
...
@@ -696,6 +698,22 @@ class GoodsService
$subShopList
=
SubShop
::
select
(
"*"
,
[
"sub_shop_id"
=>
$subShopIds
]);
$subShopList
=
SubShop
::
select
(
"*"
,
[
"sub_shop_id"
=>
$subShopIds
]);
$data
[
"goods_info"
][
"sub_shop"
]
=
$subShopList
;
$data
[
"goods_info"
][
"sub_shop"
]
=
$subShopList
;
}
}
//是否是分销活动
$runningMarketing
=
MarketingGoodsService
::
getRunningMarketing
([
$sku
[
"goods_sku_id"
]]);
$data
[
"goods_info"
][
"is_fenxiao"
]
=
false
;
if
(
!
empty
(
$runningMarketing
[
$sku
[
"goods_sku_id"
]]))
{
$data
[
"goods_info"
][
"is_fenxiao"
]
=
true
;
}
//当前人是否是团长
$data
[
"goods_info"
][
"is_tuanzhang"
]
=
false
;
if
(
!
empty
(
$params
[
"user_id"
]))
{
$distributorList
=
DistributorService
::
getDistributorInfo
(
$params
[
"user_id"
]);
if
(
!
empty
(
$distributorList
))
{
$data
[
"goods_info"
][
"is_tuanzhang"
]
=
true
;
}
}
}
}
}
}
$recordList
=
GoodsOperationRecord
::
select
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
$recordList
=
GoodsOperationRecord
::
select
(
"*"
,
[
"goods_spu_id"
=>
$goodsSpuId
]);
...
@@ -775,6 +793,22 @@ class GoodsService
...
@@ -775,6 +793,22 @@ class GoodsService
$data
[
"goods_info"
][
"sub_shop"
][
$key
][
"phone"
]
=
$sub
[
"phone"
];
$data
[
"goods_info"
][
"sub_shop"
][
$key
][
"phone"
]
=
$sub
[
"phone"
];
}
}
}
}
//是否是分销活动
$runningMarketing
=
MarketingGoodsService
::
getRunningMarketing
([
$params
[
"goods_sku_id"
]]);
$data
[
"goods_info"
][
"is_fenxiao"
]
=
false
;
if
(
!
empty
(
$runningMarketing
[
$params
[
"goods_sku_id"
]]))
{
$data
[
"goods_info"
][
"is_fenxiao"
]
=
true
;
}
//当前人是否是团长
$data
[
"goods_info"
][
"is_tuanzhang"
]
=
false
;
if
(
!
empty
(
$params
[
"user_id"
]))
{
$distributorList
=
DistributorService
::
getDistributorInfo
(
$params
[
"user_id"
]);
if
(
!
empty
(
$distributorList
))
{
$data
[
"goods_info"
][
"is_tuanzhang"
]
=
true
;
}
}
return
$data
;
return
$data
;
}
}
...
...
application/services/marketing/DistributorService.php
View file @
01a82297
...
@@ -459,4 +459,21 @@ class DistributorService
...
@@ -459,4 +459,21 @@ class DistributorService
"count"
=>
$count
]],
[]);
"count"
=>
$count
]],
[]);
return
$res
[
'id_snow'
][
$type
]
??
[];
return
$res
[
'id_snow'
][
$type
]
??
[];
}
}
/**
* 获取团长信息
* @param $userIds
* @return array
*/
public
static
function
getDistributorInfo
(
$userIds
)
{
$list
=
Distributor
::
select
([
"parent_user_id"
,
"user_id"
,
"user_name"
],
[
"user_id"
=>
$userIds
]);
$data
=
[];
if
(
!
empty
(
$list
))
{
foreach
(
$list
as
$item
)
{
$data
[
$item
[
"user_id"
]]
=
$item
;
}
}
return
$data
;
}
}
}
\ 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