配置修改
This commit is contained in:
@ -105,7 +105,49 @@ class DistributionLogic extends Logic
|
||||
];
|
||||
return DistributionMemberApply::create($data);
|
||||
}
|
||||
/**
|
||||
* 申请分销会员
|
||||
*/
|
||||
public static function wxCodeApply($post,$user_id)
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
$user_msg = User::where('id', $user_id)->find();
|
||||
$time = time();
|
||||
$data = [
|
||||
'user_id' => $user_id,
|
||||
'real_name' => $post['nickname'],
|
||||
'mobile' => $post['mobile'],
|
||||
'province' => $post['province'],
|
||||
'city' => $post['city'],
|
||||
'district' => $post['district'],
|
||||
// 'reason' => $post['reason'],
|
||||
'status' => 1,
|
||||
'create_time' => $time,
|
||||
'update_time' => $time,
|
||||
];
|
||||
DistributionMemberApply::create($data);
|
||||
|
||||
$defaultLevelId = DistributionLevel::where('is_default', 1)->value('id');
|
||||
$data = [
|
||||
'user_id' => $user_id,
|
||||
'level_id' => $defaultLevelId,
|
||||
'is_freeze' => 0,
|
||||
'remark' => '',
|
||||
'is_distribution' => 1,
|
||||
'distribution_time' => time()
|
||||
];
|
||||
|
||||
Distribution::create($data);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
static::$error = $e->getMessage();
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* 最新分销申请详情
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user