public function statistic() { $qq = count(User::where('qq_id', '!=', 'null')->get()); $weixin = count(User::where('unionid', '!=', 'null')->get()); $s = Statistic::find(1); if (isset($s)) { $s->qq = $qq; $s->weixin = $weixin; $s->save(); } else { $s = new Statistic(); $s->qq = $qq; $s->weixin = $weixin; $s->save(); } return true; }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $this->statistic->find($id)->delete(); return Redirect::route('statistics.index'); }