Compare commits
9 Commits
2de816cf73
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| edf47a5cc3 | |||
| b24dbee5b0 | |||
| 31604027e3 | |||
| 557798d558 | |||
| 1c67b47ff6 | |||
| 21b36969ff | |||
| 3411c8b129 | |||
| 83a4a941ad | |||
| d65419f69f |
@ -0,0 +1 @@
|
||||
oslWGWc_CQW7j5ihsEgwDCIM9UCRJ6F4xYpl6BoI2mU.rGo-7MeQym6vvdWtE2EmeK-QrR4vQClzR5C-LJqfurM
|
||||
@ -118,6 +118,7 @@ class DistributionLogic extends Logic
|
||||
try {
|
||||
$result = DistributionMemberApply::where('user_id',$user_id)->find();
|
||||
if($result == null){
|
||||
$url = self::makeMpWechatQrcode($user_id);
|
||||
$time = time();
|
||||
$data = [
|
||||
'user_id' => $user_id,
|
||||
@ -132,8 +133,7 @@ class DistributionLogic extends Logic
|
||||
'update_time' => $time,
|
||||
];
|
||||
DistributionMemberApply::create($data);
|
||||
$url = self::makeMpWechatQrcode($post['user_id']);
|
||||
User::update(['url'=>$url],['id'=>$post['user_id']]);
|
||||
User::where("id",$user_id)->update(['url'=>$url['data']['qr_code']]);
|
||||
$distribution = Distribution::where("user_id",$user_id)->find();
|
||||
$defaultLevelId = DistributionLevel::where('is_default', 1)->value('id');
|
||||
$data = [
|
||||
@ -150,7 +150,6 @@ class DistributionLogic extends Logic
|
||||
Distribution::create($data);
|
||||
}
|
||||
}
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
@ -375,11 +374,14 @@ class DistributionLogic extends Logic
|
||||
if($firstLeader->isEmpty()) {
|
||||
throw new \think\Exception('无效的二维码');
|
||||
}
|
||||
$user = User::where(['user_id' => $user_id])
|
||||
$user = User::where(['id' => $user_id])
|
||||
->find();
|
||||
if($user['first_leader'] != 0) {
|
||||
throw new \think\Exception('已扫码');
|
||||
}
|
||||
if($post['user_id'] == $user_id) {
|
||||
throw new \think\Exception('无法扫自己的码');
|
||||
}
|
||||
// 上级
|
||||
$first_leader_id = $firstLeader['id'];
|
||||
$data = [
|
||||
@ -388,7 +390,7 @@ class DistributionLogic extends Logic
|
||||
];
|
||||
|
||||
// 更新当前用户的分销关系
|
||||
User::where(['id' => $post['user_id']])->update($data);
|
||||
User::where(['id' => $user_id])->update($data);
|
||||
//通知用户
|
||||
event('Notice', [
|
||||
'scene' => NoticeEnum::INVITE_SUCCESS_NOTICE,
|
||||
|
||||
@ -365,7 +365,7 @@ class GoodsLogic extends Logic
|
||||
self::recordKeyword(trim($get['keyword']), $get['user_id']);
|
||||
}
|
||||
}
|
||||
if(isset($get['city_id']) && !empty($get['city_id'])) {
|
||||
if(isset($get['city_id'])) {
|
||||
$shop_msg = Shop::where("city_id",$get['city_id'])
|
||||
->where("is_run",1)
|
||||
->where("is_freeze",0)
|
||||
|
||||
0
runtime/index.html
Normal file → Executable file
0
runtime/index.html
Normal file → Executable file
Reference in New Issue
Block a user