配置修改

This commit is contained in:
2026-04-17 18:04:51 +08:00
parent 84eab66b52
commit 2ccd6787e7
2 changed files with 64 additions and 1 deletions

View File

@ -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;
}
}
/**
* 最新分销申请详情
*/