|
@@ -332,6 +332,11 @@ class WelcomeController extends BaseController
|
|
if ($status) {
|
|
if ($status) {
|
|
$is_show_activity = 1;
|
|
$is_show_activity = 1;
|
|
$bottom_show_type = 2;
|
|
$bottom_show_type = 2;
|
|
|
|
+ if($activity_setting['activity_id'] == env('OTHER_ACTIVITY_ID',0)){
|
|
|
|
+ if(!in_array($this->distribution_channel_id, explode(',', env('OTHER_ACTIVITY_CHANNEL', '1')))){
|
|
|
|
+ $is_show_activity = 0;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -1774,4 +1779,63 @@ class WelcomeController extends BaseController
|
|
$url = env('H5_SCHEME', 'https') . '://site' . $encode_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/';
|
|
$url = env('H5_SCHEME', 'https') . '://site' . $encode_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/';
|
|
return redirect()->to($url);
|
|
return redirect()->to($url);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //春分活动
|
|
|
|
+ public function vernalEquinoxActivity(Request $request)
|
|
|
|
+ {
|
|
|
|
+ $encode_distribution_channel_id = encodeDistributionChannelId($this->distribution_channel_id);
|
|
|
|
+ $token = $request->input('token');
|
|
|
|
+ $activity_info = ActivityService::getByToken($token);
|
|
|
|
+ if (!$activity_info) {
|
|
|
|
+ $default_url = env('H5_SCHEME', 'https') . '://site' . $encode_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/';
|
|
|
|
+ return redirect()->to($default_url);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $from = $request->input('fromtype', 'main');
|
|
|
|
+ $uv_key_format = 'activity:%s:distribution_channel_id:%s:date:%s:uv';
|
|
|
|
+ $pv_key_format = 'activity:%s:distribution_channel_id:%s:pv';
|
|
|
|
+ $uv_key = sprintf($uv_key_format, $activity_info->id, $this->distribution_channel_id, date('Y-m-d'));
|
|
|
|
+ $pv_key = sprintf($pv_key_format, $activity_info->id, $this->distribution_channel_id);
|
|
|
|
+ Redis::sadd($uv_key, $this->uid);
|
|
|
|
+ Redis::hincrby($pv_key, date('Y-m-d'), 1);
|
|
|
|
+ $redirect_url = env('H5_SCHEME', 'https') . '://site' . $encode_distribution_channel_id . '.' . env('CUSTOM_HOST') . '.com/person';
|
|
|
|
+ if ($request->input('redirect_url')) {
|
|
|
|
+ $redirect_url = $request->input('redirect_url');
|
|
|
|
+ $redirect_url = urldecode($redirect_url);
|
|
|
|
+ }
|
|
|
|
+ $least_charge_amount = Order::select('id', 'price')
|
|
|
|
+ ->where('uid', $this->uid)
|
|
|
|
+ ->where('status', 'PAID')
|
|
|
|
+ ->where('created_at', '>=', strtotime($activity_info->start_time) - 60 * 86400)
|
|
|
|
+ ->max('price');
|
|
|
|
+ $type = 'litter';
|
|
|
|
+ if ($least_charge_amount && $least_charge_amount >= 30) {
|
|
|
|
+ $img = 'https://cdn-novel.iycdm.com/h5/activity-2019-03-20/bg50.jpg';
|
|
|
|
+ $product_ids = 4806;
|
|
|
|
+ }else{
|
|
|
|
+ $img = 'https://cdn-novel.iycdm.com/h5/activity-2019-03-20/bg23.jpg';
|
|
|
|
+ $product_ids = 4805;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //未开始
|
|
|
|
+ if (time() < strtotime($activity_info->start_time)) {
|
|
|
|
+ return view('pay.order.vernalEquinoxActivity', ['url' => ['javascript:void(0)', 'javascript:void(0)'], 'code' => -1, 'type' => $type, 'img' => $img]);
|
|
|
|
+ }
|
|
|
|
+ //结束
|
|
|
|
+ if (time() > strtotime($activity_info->end_time)) {
|
|
|
|
+ return view('pay.order.vernalEquinoxActivity', ['url' => ['javascript:void(0)', 'javascript:void(0)'], 'code' => -2, 'type' => $type, 'img' => $img]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $param = [
|
|
|
|
+ 'uid' => $this->uid,
|
|
|
|
+ 'distribution_channel_id' => $this->distribution_channel_id,
|
|
|
|
+ 'product_id' => $product_ids,
|
|
|
|
+ 'activity_id' => $activity_info->id,
|
|
|
|
+ 'fromtype' => $from,
|
|
|
|
+ 'pay_redirect_url' => $redirect_url,
|
|
|
|
+ 'limit' => 100,
|
|
|
|
+ ];
|
|
|
|
+ $url = env('CREATE_PAY_URL') . '?' . http_build_query($param);
|
|
|
|
+ return view('pay.order.vernalEquinoxActivity', ['url' => $url, 'code' => 0, 'type' => $type, 'img' => $img]);
|
|
|
|
+ }
|
|
}
|
|
}
|