Compare commits

..

No commits in common. "786f4e8f064fee2e941534f58bc70e40e14678b8" and "a1067ea50dbbf4b6a50862652cfa0b464396ceb4" have entirely different histories.

4 changed files with 16 additions and 26 deletions

View File

@ -71,18 +71,18 @@ class IndexController extends base
// 跟进提醒 // 跟进提醒
$followMessage = 0; $followMessage = 0;
$followOrderId = ''; $followOrderId = '';
// if ($request->admin->id > 1) { if ($request->admin->id > 1) {
// $start = strtotime(date('Y-m-d')) * 1000; $start = strtotime(date('Y-m-d')) * 1000;
// $end = strtotime(date('Y-m-d', strtotime('+1 days'))) * 1000; $end = strtotime(date('Y-m-d', strtotime('+1 days'))) * 1000;
// $followMessageList = Orders::where(['admin_id' => $request->admin->id]) $followMessageList = Orders::where(['admin_id' => $request->admin->id])
// ->whereBetween('next_follow', [$start, $end]) ->whereBetween('next_follow', [$start, $end])
// ->field(['id']) ->field(['id'])
// ->select(); ->select();
// $followMessage = count($followMessageList); $followMessage = count($followMessageList);
// if ($followMessage) { if ($followMessage) {
// $followOrderId = $followMessageList[0]['id']; $followOrderId = $followMessageList[0]['id'];
// } }
// } }
return $this->success(['new' => $new ?? 0, 'follow' => $follow, 'back' => $backs, 'order_write_off' => $orderWriteOff, 'follow_message' => $followMessage, 'follow_order_id' => $followOrderId]); return $this->success(['new' => $new ?? 0, 'follow' => $follow, 'back' => $backs, 'order_write_off' => $orderWriteOff, 'follow_message' => $followMessage, 'follow_order_id' => $followOrderId]);
} }

View File

@ -489,12 +489,8 @@ class Douyin
public function _cookie($data = '') public function _cookie($data = '')
{ {
$key = 'Douyin:cookie'; if ($data) Redis::set('Douyin:cookie', $data);
if ($this->os == 5) { return Redis::get('Douyin:cookie');
$key = 'Douyin:cookie-' . $this->os;
}
if ($data) Redis::set($key, $data);
return Redis::get($key);
} }
public function _id($id = '') public function _id($id = '')
@ -553,7 +549,7 @@ class Douyin
'Content-type: application/json' 'Content-type: application/json'
]; ];
if ($method == 'GET' || $method == 'POST') { if ($method == 'GET' || $method == 'POST') {
$header[] = 'x-secsdk-csrf-token: ' . $this->_token('', $this->os); $header[] = 'x-secsdk-csrf-token: ' . $this->_token();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
} else { } else {
curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_HEADER, 1);
@ -562,16 +558,12 @@ class Douyin
$header[] = 'x-secsdk-csrf-request: 1'; $header[] = 'x-secsdk-csrf-request: 1';
} }
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($ch, CURLOPT_COOKIE, $this->_cookie('')); curl_setopt($ch, CURLOPT_COOKIE, $this->_cookie());
curl_setopt($ch, CURLOPT_HTTPHEADER, $header); curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiePath); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiePath);
if ($method == 'POST') { if ($method == 'POST') {
curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params)); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($params));
// if ($this->os == 5) {
// curl_setopt($ch, CURLOPT_COOKIE, $this->_cookie());
// }
} }
$body = curl_exec($ch); $body = curl_exec($ch);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long