|
|
@@ -114,4 +114,28 @@ class WechatExternalInterface extends Controller {
|
|
114
|
114
|
->count()
|
|
115
|
115
|
];
|
|
116
|
116
|
}
|
|
|
117
|
+ /**
|
|
|
118
|
+ * 自动回复数量
|
|
|
119
|
+ */
|
|
|
120
|
+ public function countAutoReply(Request $request) {
|
|
|
121
|
+
|
|
|
122
|
+ $today = date('Y-m-d');
|
|
|
123
|
+ $begin = $request->input('begin', $today);
|
|
|
124
|
+ $end = $request->input('end', $today);
|
|
|
125
|
+
|
|
|
126
|
+ $query = DB::table('kf_reply_msgs_call_day as m');
|
|
|
127
|
+
|
|
|
128
|
+ if ($begin !== null) {
|
|
|
129
|
+ $query->where('m.call_date', '>=', strtotime($begin));
|
|
|
130
|
+ }
|
|
|
131
|
+ if ($end !== null) {
|
|
|
132
|
+ $query->where('m.call_date', '<', strtotime($end));
|
|
|
133
|
+ }
|
|
|
134
|
+
|
|
|
135
|
+ $res = $query->select(DB::raw('m.reply_msg msgtype,sum(m.call_count) total'))
|
|
|
136
|
+ ->groupBy('m.reply_msg')
|
|
|
137
|
+ ->pluck('total', 'msgtype');
|
|
|
138
|
+
|
|
|
139
|
+ return $res;
|
|
|
140
|
+ }
|
|
117
|
141
|
}
|