Compare commits
No commits in common. "d28667b6b7edf61f913a20c81e3b687681c2a506" and "7453b46c7408b7b651b23ccbd24bc0dc5a4f9a7a" have entirely different histories.
d28667b6b7
...
7453b46c74
|
@ -28,8 +28,6 @@ class OrderController extends base
|
||||||
$where = [];
|
$where = [];
|
||||||
if(!$request->admin->is_super) {
|
if(!$request->admin->is_super) {
|
||||||
$where = [['admin_id','=', $request->admin->id]];
|
$where = [['admin_id','=', $request->admin->id]];
|
||||||
} else {
|
|
||||||
$where = [['admin_id', '>', 0]];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($sn) {
|
if($sn) {
|
||||||
|
@ -169,8 +167,6 @@ class OrderController extends base
|
||||||
$statss = Orders::DouyinStatus;
|
$statss = Orders::DouyinStatus;
|
||||||
}elseif($key ==6) {
|
}elseif($key ==6) {
|
||||||
$statss = Orders::TongchengStatus;
|
$statss = Orders::TongchengStatus;
|
||||||
}elseif($key ==6) {
|
|
||||||
$statss = Orders::OrderStatus;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$_ch = [];
|
$_ch = [];
|
||||||
|
|
|
@ -334,7 +334,7 @@ class SpiderMt extends Command
|
||||||
{
|
{
|
||||||
|
|
||||||
foreach (Orders::OSS as $k => $os) {
|
foreach (Orders::OSS as $k => $os) {
|
||||||
$pages = 10;
|
$pages = 6;
|
||||||
$page = 1;
|
$page = 1;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
@ -343,11 +343,15 @@ class SpiderMt extends Command
|
||||||
|
|
||||||
switch ($k) {
|
switch ($k) {
|
||||||
case 1:
|
case 1:
|
||||||
case 7:
|
|
||||||
try {
|
try {
|
||||||
$mei = new Meituan($k);
|
$mei = new Meituan();
|
||||||
$list = $mei->get($page, $start, $end);
|
$list = $mei->get($page, $start, $end);
|
||||||
// $pages = $mei->totalPage;
|
// $pages = $mei->totalPage;
|
||||||
|
|
||||||
|
if ($mei->totalPage === 1) {
|
||||||
|
$pages = 1;
|
||||||
|
}
|
||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Log::error(dirname(__FILE__) . __LINE__ . $e);
|
Log::error(dirname(__FILE__) . __LINE__ . $e);
|
||||||
}
|
}
|
||||||
|
@ -377,7 +381,7 @@ class SpiderMt extends Command
|
||||||
# code...
|
# code...
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
echo 'order:' . json_encode($list);
|
|
||||||
foreach ($list as $order) {
|
foreach ($list as $order) {
|
||||||
|
|
||||||
$item = Orders::where('os', $order->os)->where('sn', $order->sn)->find();
|
$item = Orders::where('os', $order->os)->where('sn', $order->sn)->find();
|
||||||
|
@ -404,7 +408,9 @@ echo 'order:' . json_encode($list);
|
||||||
$order->give_time = time();
|
$order->give_time = time();
|
||||||
|
|
||||||
//判断是否需要发短信
|
//判断是否需要发短信
|
||||||
if ((in_array($order->os, [1, 7]) && array_key_exists($order->order_status, [1 => 1, 3 => 3]))) {
|
if (($order->os == 1 && array_key_exists($order->order_status, [1 => 1, 3 => 3])) ||
|
||||||
|
($order->os == 2 && array_key_exists($order->order_status, [2 => 2, 3 => 3, 4 => 4])) ||
|
||||||
|
($order->os == 3 && $order->order_status == 1)) {
|
||||||
if ($admin_id > 0) {
|
if ($admin_id > 0) {
|
||||||
$this->sms($admin_id, $order);
|
$this->sms($admin_id, $order);
|
||||||
}
|
}
|
||||||
|
@ -432,10 +438,6 @@ echo 'order:' . json_encode($list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 数据小于50, 结束
|
|
||||||
if (count($list) < 50) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
$page++;
|
$page++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -462,8 +464,7 @@ echo 'order:' . json_encode($list);
|
||||||
$it = null;
|
$it = null;
|
||||||
switch ($item->os) {
|
switch ($item->os) {
|
||||||
case 1:
|
case 1:
|
||||||
case 7:
|
$m = new Meituan();
|
||||||
$m = new Meituan($item->os);
|
|
||||||
$it = $m->get(1, null, null, $item->sn);
|
$it = $m->get(1, null, null, $item->sn);
|
||||||
break;
|
break;
|
||||||
/* case 2:
|
/* case 2:
|
||||||
|
|
|
@ -30,7 +30,7 @@ class Orders extends base
|
||||||
];
|
];
|
||||||
|
|
||||||
const StatusName = ['待跟进', '跟进中', '已核销', '核销失败', '放弃跟单'];
|
const StatusName = ['待跟进', '跟进中', '已核销', '核销失败', '放弃跟单'];
|
||||||
const OSS = [1 => '美团', '7' => '美团(新国旅)', 2 => '快手', 3 => '抖音(甄选)', '5' => '抖音(新国旅)', '6' => '同程', 4 => '全平台'];
|
const OSS = [1 => '美团', 2 => '快手', 3 => '抖音(甄选)', '5' => '抖音(新国旅)', '6' => '同程', 4 => '全平台'];
|
||||||
|
|
||||||
const timeType = ['create_time' => '添加记录时间', 'update_time' => '修改记录时间', 'last_follow' => '最后跟进时间', 'next_follow' => '下次跟进时间', 'travel_date' => '出行时间', 'create_at' => '下单时间'];
|
const timeType = ['create_time' => '添加记录时间', 'update_time' => '修改记录时间', 'last_follow' => '最后跟进时间', 'next_follow' => '下次跟进时间', 'travel_date' => '出行时间', 'create_at' => '下单时间'];
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,9 @@ class Meituan {
|
||||||
private $cookie = '';
|
private $cookie = '';
|
||||||
private $gate = 'https://lvyou.meituan.com';
|
private $gate = 'https://lvyou.meituan.com';
|
||||||
public $totalPage = 6;
|
public $totalPage = 6;
|
||||||
public $os;
|
|
||||||
|
|
||||||
public function __construct($os = 1)
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->os = $os;
|
|
||||||
$this->cookie = $this->_cookie();
|
$this->cookie = $this->_cookie();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +51,7 @@ class Meituan {
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
'page' => $page,
|
'page' => $page,
|
||||||
'count' => 50,
|
'count' => 20,
|
||||||
'orderId' => $orderId,
|
'orderId' => $orderId,
|
||||||
'productId' => '',
|
'productId' => '',
|
||||||
'orderTimeTo' => $end ?? '',
|
'orderTimeTo' => $end ?? '',
|
||||||
|
@ -76,6 +74,10 @@ class Meituan {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($list && $list->code == 0) {
|
||||||
|
$this->totalPage = $list->data->totalPage;
|
||||||
|
}
|
||||||
|
|
||||||
$_list = [];
|
$_list = [];
|
||||||
if($list && $list->code == 0 && $list->data && is_array($list->data->orderList)) {
|
if($list && $list->code == 0 && $list->data && is_array($list->data->orderList)) {
|
||||||
foreach($list->data->orderList as $order) {
|
foreach($list->data->orderList as $order) {
|
||||||
|
@ -86,7 +88,7 @@ class Meituan {
|
||||||
sleep(100);
|
sleep(100);
|
||||||
}
|
}
|
||||||
$item = new Orders();
|
$item = new Orders();
|
||||||
$item->os = $this->os;
|
$item->os = 1;
|
||||||
$item->sn = $order->orderId;
|
$item->sn = $order->orderId;
|
||||||
$item->product_id = $order->productId;
|
$item->product_id = $order->productId;
|
||||||
$item->product_name = $order->productName;
|
$item->product_name = $order->productName;
|
||||||
|
@ -112,9 +114,8 @@ class Meituan {
|
||||||
}
|
}
|
||||||
|
|
||||||
public function _cookie($data = '') {
|
public function _cookie($data = '') {
|
||||||
$key = sprintf('Meituan:cookie-%s', $this->os);
|
if($data) Redis::set('Meituan:cookie', $data);
|
||||||
if($data) Redis::set($key, $data);
|
return Redis::get('Meituan:cookie');
|
||||||
return Redis::get($key);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function _curl($url, $params, $method = 'GET') {
|
public function _curl($url, $params, $method = 'GET') {
|
||||||
|
@ -143,10 +144,6 @@ class Meituan {
|
||||||
|
|
||||||
curl_setopt($ch, CURLOPT_COOKIE, $this->_cookie());
|
curl_setopt($ch, CURLOPT_COOKIE, $this->_cookie());
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
if ($this->os == 7) {
|
|
||||||
echo $this->os . $http;
|
|
||||||
echo $this->_cookie();
|
|
||||||
}
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
|
||||||
if($method == 'POST') {
|
if($method == 'POST') {
|
||||||
curl_setopt($ch, CURLOPT_POST, true);
|
curl_setopt($ch, CURLOPT_POST, true);
|
||||||
|
|
|
@ -92,8 +92,7 @@ class Orders {
|
||||||
|
|
||||||
switch ($order->os) {
|
switch ($order->os) {
|
||||||
case 1:
|
case 1:
|
||||||
case 7:
|
$mt = new Meituan();
|
||||||
$mt = new Meituan($order->os);
|
|
||||||
$it = $mt->get(1, null, null, $order->sn);
|
$it = $mt->get(1, null, null, $order->sn);
|
||||||
|
|
||||||
if ($it) {
|
if ($it) {
|
||||||
|
@ -174,8 +173,7 @@ class Orders {
|
||||||
$got = null;
|
$got = null;
|
||||||
switch ($order->os) {
|
switch ($order->os) {
|
||||||
case 1:
|
case 1:
|
||||||
case 7:
|
$mt = new Meituan();
|
||||||
$mt = new Meituan($order->os);
|
|
||||||
$it = $mt->get(1, null, null, $order->sn);
|
$it = $mt->get(1, null, null, $order->sn);
|
||||||
|
|
||||||
if ($it) {
|
if ($it) {
|
||||||
|
|
Loading…
Reference in New Issue