|
@@ -30,11 +30,20 @@ class GroupActivityLogic extends BaseLogic
|
|
|
/**
|
|
/**
|
|
|
* 活动分类数据
|
|
* 活动分类数据
|
|
|
*/
|
|
*/
|
|
|
- public static function categoryList($id){
|
|
|
|
|
|
|
+ public static function categoryList($id,$block_key = ''){
|
|
|
|
|
+
|
|
|
$detail = GroupActivityCategory::where('id',$id)->where('status',1)->field('id,title,images,block_data')->findOrEmpty()->toArray();
|
|
$detail = GroupActivityCategory::where('id',$id)->where('status',1)->field('id,title,images,block_data')->findOrEmpty()->toArray();
|
|
|
if($detail) {
|
|
if($detail) {
|
|
|
- $detail['images'] = $detail['images'] ? explode(",",$detail['images']) : [];
|
|
|
|
|
$detail['block_data'] = $detail['block_data'] ? json_decode($detail['block_data'],true) : [];
|
|
$detail['block_data'] = $detail['block_data'] ? json_decode($detail['block_data'],true) : [];
|
|
|
|
|
+ if ($block_key) {
|
|
|
|
|
+ foreach($detail['block_data'] as $item) {
|
|
|
|
|
+ if ($block_key == $item['block_key']) {
|
|
|
|
|
+ return $item;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $detail['images'] = $detail['images']? explode(",",$detail['images']) : [];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
return $detail;
|
|
return $detail;
|
|
|
}
|
|
}
|
|
@@ -65,7 +74,7 @@ class GroupActivityLogic extends BaseLogic
|
|
|
/**
|
|
/**
|
|
|
* @notes 拼团订单详情
|
|
* @notes 拼团订单详情
|
|
|
*/
|
|
*/
|
|
|
- public static function orderDetail($order_id,$url){
|
|
|
|
|
|
|
+ public static function orderDetail($order_id,$user_id,$url){
|
|
|
|
|
|
|
|
$detail = GroupOrder::where(['id'=>$order_id])->findOrEmpty()->toArray();
|
|
$detail = GroupOrder::where(['id'=>$order_id])->findOrEmpty()->toArray();
|
|
|
if(!empty($detail)){
|
|
if(!empty($detail)){
|
|
@@ -73,7 +82,8 @@ class GroupActivityLogic extends BaseLogic
|
|
|
'id','title','image','start_time','end_time','type','equity_id',
|
|
'id','title','image','start_time','end_time','type','equity_id',
|
|
|
'participant_num','origin_price','price','form_time_limit','area'
|
|
'participant_num','origin_price','price','form_time_limit','area'
|
|
|
])->findOrEmpty()->toArray();
|
|
])->findOrEmpty()->toArray();
|
|
|
-
|
|
|
|
|
|
|
+ $detail['is_paid'] = 0;
|
|
|
|
|
+ $detail['order_id'] = 0;
|
|
|
$detail['activity']['area'] = explode(",",$detail['activity']['area']);
|
|
$detail['activity']['area'] = explode(",",$detail['activity']['area']);
|
|
|
|
|
|
|
|
$detail['users'] = GroupUserOrder::alias('a')
|
|
$detail['users'] = GroupUserOrder::alias('a')
|
|
@@ -87,6 +97,10 @@ class GroupActivityLogic extends BaseLogic
|
|
|
if (strpos($item['avatar'], 'http') === false && !empty($item['avatar'])) {
|
|
if (strpos($item['avatar'], 'http') === false && !empty($item['avatar'])) {
|
|
|
$item['avatar'] = config('custom.cdn_url').$item['avatar'];
|
|
$item['avatar'] = config('custom.cdn_url').$item['avatar'];
|
|
|
}
|
|
}
|
|
|
|
|
+ if ($item['user_id'] == $user_id) {
|
|
|
|
|
+ $detail['is_paid'] = 1;
|
|
|
|
|
+ $detail['order_id'] = $item['id'];
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
//如果开启了模拟成团,成团后,自动填补剩余人数
|
|
//如果开启了模拟成团,成团后,自动填补剩余人数
|
|
|
if ($detail['status'] == 1 && $detail['num'] < $detail['activity']['participant_num']) {
|
|
if ($detail['status'] == 1 && $detail['num'] < $detail['activity']['participant_num']) {
|
|
@@ -382,7 +396,7 @@ class GroupActivityLogic extends BaseLogic
|
|
|
public static function getQRCode($params,$url)
|
|
public static function getQRCode($params,$url)
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
- $mnp_page = 'pages/group/orderSure';
|
|
|
|
|
|
|
+ $mnp_page = 'pages/group/team';
|
|
|
|
|
|
|
|
$scene_page = 'group';
|
|
$scene_page = 'group';
|
|
|
$response = (new WeChatMnpService())->getUnlimitedQRCode(
|
|
$response = (new WeChatMnpService())->getUnlimitedQRCode(
|