抖音增加平台

This commit is contained in:
jianghanbo 2024-08-16 21:12:33 +08:00
parent a7a5dba104
commit 4174bd5890
22 changed files with 47 additions and 34 deletions

View File

@ -578,7 +578,7 @@ export default {
flowObj: "",
os: null, // 12 3
},
os_arr: { 1: "美团", 2: "快手", 3: "抖音" },
os_arr: { 1: "美团", 2: "快手", 3: "抖音(甄选)", 4:"全平台", 5:"抖音(新国旅)" },
adminList: [],
form: {},
rules: {
@ -628,12 +628,14 @@ export default {
this.$axios
.get("/admin/order/index", { params: this.listQuery })
.then((response) => {
console.log(response);
this.list = response.data.data;
this.total = response.data.total;
(this.timetype_arr = response.ext.timetype),
(this.oss = response.ext.oss);
this.listLoading = false;
});
})
},
objectToQuery(obj) {
return Object.keys(obj)

View File

@ -657,7 +657,7 @@ export default {
flowObj: "",
os: null, // 12 3
},
os_arr: { 1: "美团", 2: "快手", 3: "抖音" },
os_arr: { 1: "美团", 2: "快手", 3: "抖音(甄选)", 5:"抖音(新国旅)" },
adminList: [],
form: {},
rules: {

View File

@ -45,6 +45,7 @@
<el-tag type="warning" v-if="scope.row.os === 1">美团</el-tag>
<el-tag type="success" v-if="scope.row.os === 2">快手</el-tag>
<el-tag type="primary" v-if="scope.row.os === 3">抖音</el-tag>
<el-tag type="primary" v-if="scope.row.os === 5">抖音(新国旅)</el-tag>
</template>
</el-table-column>
@ -144,6 +145,9 @@ export default {
}, {
value: '3',
label: '抖音'
}, {
value: '5',
label: '抖音(新国旅)'
}],
form: {}
}

View File

@ -578,7 +578,7 @@ export default {
flowObj: "",
os: null, // 12 3
},
os_arr: { 1: "美团", 2: "快手", 3: "抖音" },
os_arr: { 1: "美团", 2: "快手", 3: "抖音(甄选)", 5:"抖音(新国旅)"},
adminList: [],
form: {},
rules: {

View File

@ -157,6 +157,8 @@ class OrderController extends base
$statss = Orders::DouyinStatus;
}elseif ($key == 4) {
$statss = Orders::AllOssStatus;
}elseif($key ==5) {
$statss = Orders::DouyinStatus;
}
$_ch = [];

View File

@ -67,7 +67,6 @@ class SpiderDy extends Command
$status .= $routeType;
if (empty($this->_redis_pool[$status])) {
$this->_redis_pool[$status] = Redis::hGetAll('CRM:Pool:' . $status);
$routeType = AdminController::ROUTE_LISTS[mb_substr($categoryDesc, 0, 2)] ?? 10;
$users = $this->users($routeType);
$_users = [];
if (empty($this->_redis_pool[$status])) {
@ -332,10 +331,11 @@ class SpiderDy extends Command
break;*/
case 3:
case 5:
// echo '==========pages='.$pages;
try {
$dou = new Douyin();
$list = $dou->get($page, $start, $end);
$list = $dou->get($page, $start, $end, '', $k);
$pages = $dou->totalPage;
} catch (\Exception $e) {
Log::error(dirname(__FILE__) . __LINE__ . $e);
@ -349,7 +349,7 @@ class SpiderDy extends Command
foreach ($list as $order) {
// 过滤一日游
if (strpos('一日游', $order->category_desc) !== false) {
if ($order->os == 3 && strpos('一日游', $order->category_desc) !== false) {
continue;
}
@ -434,8 +434,9 @@ class SpiderDy extends Command
$it = $m->get(1, null, null, $item->sn);
break;*/
case 3:
$m = new Douyin();
$it = $m->get(1, null, null, $item->sn);
case 5:
$m = new Douyin($item->os);
$it = $m->get(1, null, null, $item->sn, $item->os);
break;
default:

View File

@ -27,7 +27,7 @@ class Orders extends base
];
const StatusName = ['待跟进', '跟进中', '已核销', '核销失败', '放弃跟单'];
const OSS = [1 => '美团', 2 => '快手', 3 => '抖音', 4 => '全平台'];
const OSS = [1 => '美团', 2 => '快手', 3 => '抖音(甄选)', '5' => '抖音(新国旅)', 4 => '全平台'];
const timeType = ['create_time' => '添加记录时间', 'update_time' => '修改记录时间', 'last_follow' => '最后跟进时间', 'next_follow' => '下次跟进时间', 'travel_date' => '出行时间', 'create_at' => '下单时间'];

View File

@ -20,11 +20,12 @@ class Douyin
public $totalPage = 6;
private $keywords = ['泰国', '普吉岛', '西藏', 'S', 'G', 's', 'g'];
public function __construct()
public function __construct($os = 3)
{
$this->cookie = $this->_cookie();
$this->id = $this->_id();
$this->token = $this->_token();
$this->token = $this->_token($os);
Log::info("抖音 token{$this->token} \n\n"); ;
}
public function login()
@ -135,7 +136,7 @@ class Douyin
* @throws DbException
* @throws Exception
*/
public function get($page, $start = null, $end = null, $orderId = '')
public function get($page, $start = null, $end = null, $orderId = '', $osId = 3)
{
if (empty($start) || empty($end)) {
$start = date('Y-m-d 00:00:00');
@ -155,7 +156,7 @@ class Douyin
}
$_list = [];
$list = $this->_certificateList($start, $end, $page, $orderId);
$list = $this->_certificateList($start, $end, $page, $orderId, $osId);
if (empty($list->data->list) || $list->status_code !== 0) {
$this->totalPage = 1;
return $_list;
@ -171,7 +172,7 @@ class Douyin
}
$item = new Orders();
$item->os = 3;
$item->os = $osId;
$item->sn = $order->order_id;
$item->product_id = $order->sku->sku_id;
$item->product_name = $order->sku->title;
@ -201,7 +202,7 @@ class Douyin
//if(mb_strrpos($item->product_name, "S") === false) continue; G 达人 S 自己
// if (!(mb_strrpos($item->product_name, "S") || mb_strrpos($item->product_name, "G") || mb_strrpos($item->product_name, "甄"))) continue;
$kw_match = false;
foreach ($this->keywords as $kw) {
@ -225,7 +226,7 @@ class Douyin
/**
* @throws Exception
*/
public function _certificateList($start, $end, $page, $orderId)
public function _certificateList($start, $end, $page, $orderId, $osId = '')
{
$params = [
"filter" => [
@ -498,10 +499,11 @@ class Douyin
protected $_try = 0;
public function _token($token = '')
public function _token($token = '', $os = 3)
{
if ($token) Redis::set('Douyin:token', $token, 'ex', 3600 * 24 - 50);
$token = Redis::get('Douyin:token');
$dyKey = sprintf('Douyin:token-%s', $os);
if ($token) Redis::set($dyKey, $token, 'ex', 3600 * 24 - 50);
$token = Redis::get($dyKey);
if (empty($token) && $this->_cookie()) {
if ($this->_try > 3) {
throw new Exception("cookie 失效");
@ -509,10 +511,10 @@ class Douyin
$id = $this->_curl('/life/gate/v1/user/detail', null, 'HEAD');
$this->_try++;
if ($id) {
Redis::set('Douyin:token', $id, 'ex', 3600 * 24 - 50);
Redis::set($dyKey, $id, 'ex', 3600 * 24 - 50);
}
}
return Redis::get('Douyin:token');
return Redis::get($dyKey);
}
public function _curl($url, $params, $method = 'GET')

View File

@ -96,7 +96,8 @@ class Orders {
break;
case 3:
$dy = new Douyin();
case 5:
$dy = new Douyin($order->os);
$it = $dy->get(1, null, null, $order->sn);
if ($it) {
$got = $it[0];
@ -176,7 +177,8 @@ class Orders {
break;
case 3:
$dy = new Douyin();
case 5:
$dy = new Douyin($order->os);
$it = $dy->get(1, null, null, $order->sn);
if ($it) {
$got = $it[0];

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-0bd80270]{position:relative;padding-bottom:60px}.el-table[data-v-0bd80270],.filter-container[data-v-0bd80270]{padding-bottom:5px}
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-5405875d]{position:relative;padding-bottom:60px}.el-table[data-v-5405875d],.filter-container[data-v-5405875d]{padding-bottom:5px}

View File

@ -1 +1 @@
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-f5f5d78a]{position:relative;padding-bottom:60px}.el-table[data-v-f5f5d78a],.filter-container[data-v-f5f5d78a]{padding-bottom:52px}
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-6b6b0ada]{position:relative;padding-bottom:60px}.el-table[data-v-6b6b0ada],.filter-container[data-v-6b6b0ada]{padding-bottom:52px}

View File

@ -1 +1 @@
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-d6692e38]{position:relative;padding-bottom:60px}.el-table[data-v-d6692e38],.filter-container[data-v-d6692e38]{padding-bottom:52px}
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-1e421b1e]{position:relative;padding-bottom:60px}.el-table[data-v-1e421b1e],.filter-container[data-v-1e421b1e]{padding-bottom:52px}

View File

@ -1 +1 @@
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-26156252]{position:relative;padding-bottom:60px}.el-table[data-v-26156252],.filter-container[data-v-26156252]{padding-bottom:52px}
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-a4242dbc]{position:relative;padding-bottom:60px}.el-table[data-v-a4242dbc],.filter-container[data-v-a4242dbc]{padding-bottom:52px}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long