value('id'); // 分销会员开通方式 $apply_condition = ConfigServer::get('distribution', 'apply_condition', 2); $isDistribution = $apply_condition == 1 ? 1 : 0; $data = [ 'user_id' => $userId, 'level_id' => $defaultLevelId, 'is_distribution' => $isDistribution, 'is_freeze' => 0, 'remark' => '', ]; if($isDistribution) { // 成为分销会员时间 $data['distribution_time'] = time(); } Distribution::create($data); } }