本文整理汇总了PHP中Wechat::getForeverQrCodeUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Wechat::getForeverQrCodeUrl方法的具体用法?PHP Wechat::getForeverQrCodeUrl怎么用?PHP Wechat::getForeverQrCodeUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Wechat
的用法示例。
在下文中一共展示了Wechat::getForeverQrCodeUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store
public function store(Request $request)
{
$user = \Helper::getUser();
$customer = \Helper::getCustomer();
if ($customer->is_registered) {
return '请勿重复注册';
}
$validator = \Validator::make($request->all(), ['phone' => 'required|digits:11|unique:customers,phone,' . $customer->id, 'code' => 'required|digits:6']);
if ($validator->fails()) {
return redirect()->back()->withErrors($validator)->withInput();
}
if ($request->input('code') != $customer->auth_code || $request->input('code') == '000000') {
return redirect()->back()->with('error_message', '验证码不匹配!')->withInput();
}
if (Carbon::now()->diffInMinutes($customer->auth_code_expire) > 0) {
return redirect()->back()->with('error_message', '验证码过期!')->withInput();
}
$beans_total_update = 0;
if ($customer->beans_total > 0) {
$beans_total_update = $customer->beans_total;
}
$customer->update(['phone' => $request->input('phone'), 'is_registered' => true, 'beans_total' => $beans_total_update, 'nickname' => $user['nickname'], 'head_image_url' => $user['headimgurl'], 'qr_code' => \Wechat::getForeverQrCodeUrl($customer->id)]);
if ($ci = CustomerInformation::where('phone', '=', $request->input('phone'))->first()) {
$ci->customer_id = $customer->id;
$ci->save();
}
// $ret = $customer->register();
if ($customer->referrer_id) {
// \BeanRecharger::invite($customer->getReferrer());
\Analyzer::updateBasicStatistics($customer->referrer_id, AnalyzerConstant::CUSTOMER_FRIEND);
}
\EnterpriseAnalyzer::updateBasic(AnalyzerConstant::ENTERPRISE_REGISTER);
event(new Register($customer));
if (\Session::has('register_next_url')) {
return redirect(\Session::get('register_next_url'));
}
return redirect('register/success');
}
示例2: friend
public function friend()
{
$customer = \Helper::getCustomer();
if (!$customer->qr_code) {
$customer->qr_code = \Wechat::getForeverQrCodeUrl($customer->id);
$customer->save();
}
$data['qrCode'] = $customer->qr_code;
return view('personal.friend', ['data' => $data]);
}