fix reg
This commit is contained in:
@@ -186,7 +186,7 @@ class GoodController extends Controller
|
||||
//$data['tags'] = Tag::orderby('id', 'asc')->get();
|
||||
if(!$user || $user->baned)
|
||||
return view::make('good.goodInfoForm')->with($data)->withErrors('您的账号被封禁,无法出售商品,请联系系统管理员');
|
||||
if(UserInfo::where('user_id', $user_id)->count() == 0)
|
||||
if(UserInfo::where('user_id', $user_id)->count() == 0 && !$user->wechat_open_id)
|
||||
return view::make('good.goodInfoForm')->with($data)->withErrors('你必须先添加联系方式才能出售');
|
||||
return view::make('good.goodInfoForm')->with($data);
|
||||
}
|
||||
@@ -197,7 +197,7 @@ class GoodController extends Controller
|
||||
$user = User::find($user_id);
|
||||
if(!$user || $user->baned)
|
||||
return Redirect::back()->withInput()->withErrors('您的账号被封禁,请联系系统管理员');
|
||||
if(UserInfo::where('user_id', $user_id)->count() == 0)
|
||||
if(UserInfo::where('user_id', $user_id)->count() == 0 && !$user->wechat_open_id)
|
||||
return Redirect::back()->withInput()->withErrors('你必须添加联系方式才能出售');
|
||||
$input = $request->all();
|
||||
$good = new GoodInfo;
|
||||
|
||||
@@ -29,7 +29,7 @@ class TransactionController extends Controller
|
||||
$user = User::find($user_id);
|
||||
if(!$user || $user->baned)
|
||||
return Redirect::back()->withInput()->withErrors('您的账号被封禁,请联系系统管理员');
|
||||
if(UserInfo::where('user_id', $user_id)->count() == 0)
|
||||
if(UserInfo::where('user_id', $user_id)->count() == 0 && !$user->wechat_open_id)
|
||||
return Redirect::back()->withInput()->withErrors('你必须添加联系方式才能购买');
|
||||
$count = $request->count;
|
||||
$result = $this->buy($good_id, $user_id, $count, $request->ip());
|
||||
|
||||
@@ -20,8 +20,8 @@ class RegisterComplete
|
||||
if($request->session()->has('user_id'))
|
||||
{
|
||||
$user = User::find($request->session()->get('user_id'));
|
||||
if($user->registerCompletion())
|
||||
return Redirect::to('/register/' . $user->registerCompletion());
|
||||
if($user->registerCompletion(true))
|
||||
return Redirect::to('/register/' . $user->registerCompletion(true));
|
||||
return $next($request);
|
||||
}
|
||||
else
|
||||
|
||||
+2
-2
@@ -16,9 +16,9 @@ class User extends Model
|
||||
return $this->hasMany('App\UserInfo');
|
||||
}
|
||||
|
||||
public function registerCompletion()
|
||||
public function registerCompletion($force = false)
|
||||
{
|
||||
if ($this->nickname == null || !Storage::exists('avatar/' . $this->id)) {
|
||||
if (!$force && ($this->nickname == null || !Storage::exists('avatar/' . $this->id))) {
|
||||
return 2;
|
||||
} else if (count($this->user_infos) == 0 && $this->wechat_open_id == null) {
|
||||
return 3;
|
||||
|
||||
@@ -79,6 +79,9 @@
|
||||
<th nowrap="nowrap">地址</th>
|
||||
</tr>
|
||||
|
||||
@if(count($seller->user_infos) == 0)
|
||||
<tr><td nowrap="nowrap" colspan="5">该用户没有填写联系方式,你们可以通过“消息”来联系。“消息”会通过东大小秘书微信公众号进行推送。</td></tr>
|
||||
@endif
|
||||
@foreach($seller->user_infos as $userinfo)
|
||||
<tr>
|
||||
<td nowrap="nowrap">{{ $seller->realname }}</td>
|
||||
@@ -103,6 +106,9 @@
|
||||
<th nowrap="nowrap">地址</th>
|
||||
</tr>
|
||||
|
||||
@if(count($buyer->user_infos) == 0)
|
||||
<tr><td nowrap="nowrap" colspan="5">该用户没有填写联系方式,你们可以通过“消息”来联系。“消息”会通过东大小秘书微信公众号进行推送。</td></tr>
|
||||
@endif
|
||||
@foreach($buyer->user_infos as $userinfo)
|
||||
<tr>
|
||||
<td nowrap="nowrap">{{ $buyer->realname }}</td>
|
||||
|
||||
Reference in New Issue
Block a user