Merge branch 'dev' of https://gitea.lihaink.cn/mkm/shop-php into dev
This commit is contained in:
commit
559376a22b
@ -116,12 +116,12 @@ class StoreActivityUserDao extends BaseDao
|
|||||||
->where('activity_id', $activityId)
|
->where('activity_id', $activityId)
|
||||||
->where('status', StoreActivityOrder::STATUS_VALID)
|
->where('status', StoreActivityOrder::STATUS_VALID)
|
||||||
->find();
|
->find();
|
||||||
if (empty($myOrder)) {
|
$userInfo = User::where('spread_uid', $userId)->field('uid,nickname,avatar')->select()->toArray();
|
||||||
|
if (empty($myOrder)||empty($myOrder['total_amount'])) {
|
||||||
return ['target' => $target, 'allow_receive' => false, 'user_info' => $userInfo];
|
return ['target' => $target, 'allow_receive' => false, 'user_info' => $userInfo];
|
||||||
}
|
}
|
||||||
$storeConsumptionUserDao = new StoreConsumptionUserDao();
|
$storeConsumptionUserDao = new StoreConsumptionUserDao();
|
||||||
$scope = $storeConsumptionUserDao->getScope($consumption, $myOrder['total_amount']);
|
$scope = $storeConsumptionUserDao->getScope($consumption, $myOrder['total_amount']);
|
||||||
$userInfo = User::where('spread_uid', $userId)->field('uid,nickname,avatar')->select()->toArray();
|
|
||||||
$orders = StoreActivityOrder::where('spread_id', $userId)
|
$orders = StoreActivityOrder::where('spread_id', $userId)
|
||||||
->whereIn('user_id', array_column($userInfo, 'uid'))
|
->whereIn('user_id', array_column($userInfo, 'uid'))
|
||||||
->where('activity_id', $activityId)
|
->where('activity_id', $activityId)
|
||||||
|
@ -25,7 +25,15 @@ class StoreConsumptionDao extends BaseDao
|
|||||||
*/
|
*/
|
||||||
public function getValidList()
|
public function getValidList()
|
||||||
{
|
{
|
||||||
return StoreConsumption::whereIn('type', [StoreConsumption::TYPE_OWNER_CONSUMPTION, StoreConsumption::TYPE_PULL_CONSUMPTION])->where('status', StoreConsumption::STATUS_ENABLE)->field('coupon_id,start_time,end_time,title')->select();
|
return StoreConsumption::whereIn('type', [StoreConsumption::TYPE_OWNER_CONSUMPTION, StoreConsumption::TYPE_PULL_CONSUMPTION])->where('status', StoreConsumption::STATUS_ENABLE)
|
||||||
|
->field('coupon_id,start_time,end_time,title')->select()->each(function ($item){
|
||||||
|
if($item['title']=='无门槛实物通用红包'){
|
||||||
|
$item['title'] = '用户推荐拉新活动';
|
||||||
|
}else{
|
||||||
|
$item['title'] = '用户消费补贴活动';
|
||||||
|
}
|
||||||
|
return $item;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getOne($id)
|
public function getOne($id)
|
||||||
|
@ -673,6 +673,10 @@ class UserRepository extends BaseRepository
|
|||||||
];
|
];
|
||||||
if($code){
|
if($code){
|
||||||
$data['promotion_code']=$code;
|
$data['promotion_code']=$code;
|
||||||
|
$shop=explode('shop_',$code);
|
||||||
|
if(count($shop)==2){
|
||||||
|
$data['spread_uid']=$shop[1];
|
||||||
|
}
|
||||||
Cache::delete('promote_'.$ip);
|
Cache::delete('promote_'.$ip);
|
||||||
}
|
}
|
||||||
return $this->create($user_type, $data);
|
return $this->create($user_type, $data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user