Pārlūkot izejas kodu

新增自动回复数量接口

zhoufan 4 gadi atpakaļ
vecāks
revīzija
1ffaa9b769

+ 24 - 0
dtkf_new/app/Http/Controllers/Dtkf/WechatExternalInterface.php

@@ -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
 }

+ 1 - 0
dtkf_new/routes/api.php

@@ -21,6 +21,7 @@ Route::prefix('external')->middleware('cross')->group(function () {
21 21
 	Route::get('wxcount', 'Dtkf\WechatExternalInterface@countMsg'); //统计消息数
22 22
 	Route::get('wxreply', 'Dtkf\WechatExternalInterface@countReply'); //统计回复数
23 23
 	Route::get('wxmonth', 'Dtkf\WechatExternalInterface@countMonth'); //微信月统计
24
+	Route::get('wxautoreply', 'Dtkf\WechatExternalInterface@countAutoReply'); //自动回复数
24 25
 
25 26
 	Route::get('wbmsg', 'Dtkf\WeiboExternalInterface@msg'); //获取消息
26 27
 	Route::get('wbcount', 'Dtkf\WeiboExternalInterface@countMsg'); //统计消息数

+ 1 - 1
dtkf_new/vendor/laravel/framework/src/Illuminate/Mail/TransportManager.php

@@ -179,7 +179,7 @@ class TransportManager extends Manager
179 179
     protected function guzzle($config)
180 180
     {
181 181
         return new HttpClient(Arr::add(
182
-            $config['guzzle'] ?? [], 'connect_timeout', 60
182
+            $config['guzzle'] ?? [], 'connect_timeout', 150
183 183
         ));
184 184
     }
185 185
 

+ 2 - 2
dtkf_new/vendor/laravel/framework/src/Illuminate/Queue/Connectors/SqsConnector.php

@@ -38,8 +38,8 @@ class SqsConnector implements ConnectorInterface
38 38
         return array_merge([
39 39
             'version' => 'latest',
40 40
             'http' => [
41
-                'timeout' => 60,
42
-                'connect_timeout' => 60,
41
+                'timeout' => 150,
42
+                'connect_timeout' => 150,
43 43
             ],
44 44
         ], $config);
45 45
     }

+ 1 - 1
dtkf_new/vendor/overtrue/wechat/src/Kernel/BaseClient.php

@@ -130,7 +130,7 @@ class BaseClient
130 130
             $multipart[] = compact('name', 'contents');
131 131
         }
132 132
 
133
-        return $this->request($url, 'POST', ['query' => $query, 'multipart' => $multipart, 'connect_timeout' => 30, 'timeout' => 30, 'read_timeout' => 30]);
133
+        return $this->request($url, 'POST', ['query' => $query, 'multipart' => $multipart, 'connect_timeout' => 150, 'timeout' => 150, 'read_timeout' => 150]);
134 134
     }
135 135
 
136 136
     /**