public function articleIndex(Request $request) { $customer = \Helper::getCustomerOrNull(); if (!$customer) { if (!$customer->articleIndexNeedFeedBack()) { \Log::info('hongbao---111'); } else { \Log::info('hongbao---222'); } } else { \Log::info('hongbao---333'); } if (!$customer || !$customer->articleIndexNeedFeedBack()) { \Log::info('hongbao---不存在'); \Analyzer::updateBasicStatistics($customer->id, AnalyzerConstant::CUSTOMER_ARTICLE); return redirect("http://mp.weixin.qq.com/mp/homepage?__biz=MzI4NTAxMzc3Mw==&hid=1&sn=740141c97f60c8630a87a3f0c344a504#wechat_redirect"); } else { \Log::info('hongbao---存在'); $count = $customer->readArticleIndex(); \BeanRecharger::executeEducation($customer); \Analyzer::updateBasicStatistics($customer->id, AnalyzerConstant::CUSTOMER_ARTICLE); return view('education.hongbao')->with(['redirect_url' => "http://mp.weixin.qq.com/mp/homepage?__biz=MzI4NTAxMzc3Mw==&hid=1&sn=740141c97f60c8630a87a3f0c344a504#wechat_redirect", 'count' => $count]); } }
public function updateBean(Request $request) { $customer = \Helper::getCustomer(); if (!$customer) { return response()->json(['result' => '-1']); } /*if>*/ if (!$customer->is_registered) { return response()->json(['result' => '-1']); } /*if>*/ $article = Article::where('id', $request->input('id'))->first(); \Analyzer::updateArticleStatistics($customer->id, $article->type_id); \Analyzer::updateBasicStatistics($customer->id, AnalyzerConstant::CUSTOMER_ARTICLE); \EnterpriseAnalyzer::updateArticleStatistics($article->type_id); \EnterpriseAnalyzer::updateBasic(AnalyzerConstant::ENTERPRISE_ARTICLE); if (\DailyAnalyzer::getDailyItemCount($customer->id, AnalyzerConstant::CUSTOMER_DAILY_ARTICLE)) { \DailyAnalyzer::updateDailyItemCount($customer->id, AnalyzerConstant::CUSTOMER_DAILY_ARTICLE); return response()->json(['result' => '-1']); } \DailyAnalyzer::updateDailyItemCount($customer->id, AnalyzerConstant::CUSTOMER_DAILY_ARTICLE); \BeanRecharger::executeEducation($customer); return response()->json(['result' => '1']); }