配置修改
This commit is contained in:
@ -113,26 +113,23 @@ class DistributionLogic extends Logic
|
|||||||
Db::startTrans();
|
Db::startTrans();
|
||||||
try {
|
try {
|
||||||
$result = DistributionMemberApply::where('user_id',$user_id)->find();
|
$result = DistributionMemberApply::where('user_id',$user_id)->find();
|
||||||
if($result != null){
|
if($result == null){
|
||||||
Db::commit();
|
$time = time();
|
||||||
return true;
|
$data = [
|
||||||
}
|
'user_id' => $user_id,
|
||||||
// $user_msg = User::where('id', $user_id)->find();
|
'real_name' => $post['real_name'],
|
||||||
$time = time();
|
'mobile' => $post['mobile'],
|
||||||
$data = [
|
'province' => $post['province'],
|
||||||
'user_id' => $user_id,
|
'city' => $post['city'],
|
||||||
'real_name' => $post['real_name'],
|
'district' => $post['district'],
|
||||||
'mobile' => $post['mobile'],
|
|
||||||
'province' => $post['province'],
|
|
||||||
'city' => $post['city'],
|
|
||||||
'district' => $post['district'],
|
|
||||||
// 'reason' => $post['reason'],
|
// 'reason' => $post['reason'],
|
||||||
'status' => 1,
|
'status' => 1,
|
||||||
'create_time' => $time,
|
'create_time' => $time,
|
||||||
'update_time' => $time,
|
'update_time' => $time,
|
||||||
];
|
];
|
||||||
DistributionMemberApply::create($data);
|
DistributionMemberApply::create($data);
|
||||||
|
}
|
||||||
|
$distribution = Distribution::where("user_id",$user_id)->find();
|
||||||
$defaultLevelId = DistributionLevel::where('is_default', 1)->value('id');
|
$defaultLevelId = DistributionLevel::where('is_default', 1)->value('id');
|
||||||
$data = [
|
$data = [
|
||||||
'user_id' => $user_id,
|
'user_id' => $user_id,
|
||||||
@ -142,8 +139,11 @@ class DistributionLogic extends Logic
|
|||||||
'is_distribution' => 1,
|
'is_distribution' => 1,
|
||||||
'distribution_time' => time()
|
'distribution_time' => time()
|
||||||
];
|
];
|
||||||
|
if($distribution != null){
|
||||||
Distribution::create($data);
|
Distribution::update($data,['user_id'=>$user_id]);
|
||||||
|
}else{
|
||||||
|
Distribution::create($data);
|
||||||
|
}
|
||||||
Db::commit();
|
Db::commit();
|
||||||
return true;
|
return true;
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user