| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847 |
- using dodohold.core;
- using System.Text.Json;
- namespace molilian.core
- {
- public partial class AlimamaPlus
- {
- private const string base_orders_url = "https://pub.alimama.com/openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json";
- public async Task<int> GetHistoryOrdersAsync(int sleep, DateTime startTime, DateTime endTime)
- {
- //DateTime endTime = DateTime.Now;
- //DateTime startTime = endTime.AddDays(-90);
- //if (_accountId == 3) endTime = DateTime.Parse("2024-04-07");
- //#if DEBUG
- // startTime = DateTime.Parse("2024-05-01");
- // endTime = DateTime.Parse("2024-06-01");
- // int total = 0;
- // List<DateTime> orderTimes = new List<DateTime>();
- // for (DateTime date = startTime; date <= endTime; date = date.AddDays(1))
- // {
- // orderTimes.Add(date);
- // }
- //#else
- //#endif
- //当日往前查询
- (int total, DateTime max_modifiedTime, List<DateTime> orderTimes) = await GetTkOrdersAsync(startTime, endTime, DateTime.MinValue, false, sleep);
- if (_account.is_hide) return total;
- string sql = @"
- UPDATE tk_report tr
- JOIN (
- SELECT
- accountId, DATE(tbPaidTime) AS date, SUM(alipayTotalPrice) AS order_ord_amt,
- COUNT(*) AS order_ord_num, SUM(pubShareFeeForCommission) AS order_ord_tfee
- FROM tk_order_details
- WHERE DATE(tbPaidTime) IN @orderTimes AND tkStatus=3 AND accountId=@accountId
- GROUP BY DATE(tbPaidTime), accountId
- ) AS sub
- ON tr.accountId = sub.accountId AND tr.report_date = sub.date
- SET tr.order_ord_amt = sub.order_ord_amt, tr.order_ord_num_3 = sub.order_ord_num,
- tr.order_ord_tfee = sub.order_ord_tfee;";
- DBContext.Execute(sql, new { accountId = _accountId, orderTimes });
- sql = @"
- UPDATE tk_report tr
- JOIN (
- SELECT
- accountId, DATE(tbPaidTime) AS date, SUM(alipayTotalPrice) AS order_ord_amt,
- COUNT(*) AS order_ord_num, SUM(pubSharePreFeeForCommission) AS order_ord_tfee
- FROM tk_order_details
- WHERE DATE(tbPaidTime) IN @orderTimes AND tkStatus=12 AND accountId=@accountId
- GROUP BY DATE(tbPaidTime), accountId
- ) AS sub
- ON tr.accountId = sub.accountId AND tr.report_date = sub.date
- SET tr.order_ord_amt_12 = sub.order_ord_amt, tr.order_ord_num_12 = sub.order_ord_num,
- tr.order_ord_tfee_12 = sub.order_ord_tfee;";
- DBContext.Execute(sql, new { accountId = _accountId, orderTimes });
- sql = @"
- UPDATE tk_report tr
- JOIN (
- SELECT
- accountId, DATE(tbPaidTime) AS date, SUM(alipayTotalPrice) AS order_ord_amt,
- COUNT(*) AS order_ord_num, SUM(pubSharePreFeeForCommission) AS order_ord_tfee
- FROM tk_order_details
- WHERE DATE(tbPaidTime) IN @orderTimes AND tkStatus=13 AND accountId=@accountId
- GROUP BY DATE(tbPaidTime), accountId
- ) AS sub
- ON tr.accountId = sub.accountId AND tr.report_date = sub.date
- SET tr.order_ord_amt_13 = sub.order_ord_amt, tr.order_ord_num_13 = sub.order_ord_num,
- tr.order_ord_tfee_13 = sub.order_ord_tfee;";
- DBContext.Execute(sql, new { accountId = _accountId, orderTimes });
- sql = @"
- UPDATE tk_report tr
- JOIN (
- SELECT
- accountId, DATE(tbPaidTime) AS date, SUM(alipayTotalPrice) AS order_ord_amt,
- COUNT(*) AS order_ord_num, SUM(pubSharePreFeeForCommission) AS order_ord_tfee
- FROM tk_order_details
- WHERE DATE(tbPaidTime) IN @orderTimes AND tkStatus=14 AND accountId=@accountId
- GROUP BY DATE(tbPaidTime), accountId
- ) AS sub
- ON tr.accountId = sub.accountId AND tr.report_date = sub.date
- SET tr.order_ord_amt_14 = sub.order_ord_amt, tr.order_ord_num_14 = sub.order_ord_num,
- tr.order_ord_tfee_14 = sub.order_ord_tfee;";
- DBContext.Execute(sql, new { accountId = _accountId, orderTimes });
- sql = @"UPDATE tk_report
- SET order_ord_num = order_ord_num_3 + order_ord_num_12 + order_ord_num_13 + order_ord_num_14
- WHERE DATE(report_date) IN @orderTimes AND accountId=@accountId;";
- DBContext.Execute(sql, new { accountId = _accountId, orderTimes });
- return total;
- }
- public async Task<int> GetIncyOrdersAsync(int sleep)
- {
- string cacheKey = $":cache:GetIncyOrders:{_accountName}";
- string cacheKey2 = $":cache:GetIncyOrders:{_accountId}";
- DateTime endTime = DateTime.Now;
- DateTime startTime = endTime.AddDays(-1);
- DateTime last_modifiedTime = RedisHelper.Get<DateTime>(cacheKey);
- ////找出数据库最新的一天
- //var last = new DBContext.Table("tk_order_details")
- // .Order("modifiedTime DESC")
- // .Get<TkOrderDetailDTO>("accountId=@accountId", new { accountId = _accountId });
- if (last_modifiedTime != DateTime.MinValue)
- {
- startTime = last_modifiedTime;
- }
- else
- {
- last_modifiedTime = startTime;
- }
- //当日往前查询
- (int total, DateTime max_modifiedTime, List<DateTime> orderTimes) = await GetTkOrdersAsync(startTime, endTime, last_modifiedTime, true, sleep);
- if (max_modifiedTime != DateTime.MinValue)
- {
- RedisHelper.Set(cacheKey, max_modifiedTime);
- RedisHelper.Set(cacheKey2, max_modifiedTime);
- }
- if (_account.is_hide) return total;
- //todo 根据orderTimes、settlementTimes 更新被影响的相关行
- string sql = @"
- UPDATE tk_report tr
- JOIN (
- SELECT
- accountId, DATE(tbPaidTime) AS date, SUM(alipayTotalPrice) AS order_ord_amt,
- COUNT(*) AS order_ord_num, SUM(pubShareFeeForCommission) AS order_ord_tfee
- FROM tk_order_details
- WHERE DATE(tbPaidTime) IN @orderTimes AND tkStatus=3 AND accountId=@accountId
- GROUP BY DATE(tbPaidTime), accountId
- ) AS sub
- ON tr.accountId = sub.accountId AND tr.report_date = sub.date
- SET tr.order_ord_amt = sub.order_ord_amt, tr.order_ord_num_3 = sub.order_ord_num,
- tr.order_ord_tfee = sub.order_ord_tfee;";
- DBContext.Execute(sql, new { accountId = _accountId, orderTimes });
- sql = @"
- UPDATE tk_report tr
- JOIN (
- SELECT
- accountId, DATE(tbPaidTime) AS date, SUM(alipayTotalPrice) AS order_ord_amt,
- COUNT(*) AS order_ord_num, SUM(pubSharePreFeeForCommission) AS order_ord_tfee
- FROM tk_order_details
- WHERE DATE(tbPaidTime) IN @orderTimes AND tkStatus=12 AND accountId=@accountId
- GROUP BY DATE(tbPaidTime), accountId
- ) AS sub
- ON tr.accountId = sub.accountId AND tr.report_date = sub.date
- SET tr.order_ord_amt_12 = sub.order_ord_amt, tr.order_ord_num_12 = sub.order_ord_num,
- tr.order_ord_tfee_12 = sub.order_ord_tfee;";
- DBContext.Execute(sql, new { accountId = _accountId, orderTimes });
- sql = @"
- UPDATE tk_report tr
- JOIN (
- SELECT
- accountId, DATE(tbPaidTime) AS date, SUM(alipayTotalPrice) AS order_ord_amt,
- COUNT(*) AS order_ord_num, SUM(pubSharePreFeeForCommission) AS order_ord_tfee
- FROM tk_order_details
- WHERE DATE(tbPaidTime) IN @orderTimes AND tkStatus=13 AND accountId=@accountId
- GROUP BY DATE(tbPaidTime), accountId
- ) AS sub
- ON tr.accountId = sub.accountId AND tr.report_date = sub.date
- SET tr.order_ord_amt_13 = sub.order_ord_amt, tr.order_ord_num_13 = sub.order_ord_num,
- tr.order_ord_tfee_13 = sub.order_ord_tfee;";
- DBContext.Execute(sql, new { accountId = _accountId, orderTimes });
- sql = @"
- UPDATE tk_report tr
- JOIN (
- SELECT
- accountId, DATE(tbPaidTime) AS date, SUM(alipayTotalPrice) AS order_ord_amt,
- COUNT(*) AS order_ord_num, SUM(pubSharePreFeeForCommission) AS order_ord_tfee
- FROM tk_order_details
- WHERE DATE(tbPaidTime) IN @orderTimes AND tkStatus=14 AND accountId=@accountId
- GROUP BY DATE(tbPaidTime), accountId
- ) AS sub
- ON tr.accountId = sub.accountId AND tr.report_date = sub.date
- SET tr.order_ord_amt_14 = sub.order_ord_amt, tr.order_ord_num_14 = sub.order_ord_num,
- tr.order_ord_tfee_14 = sub.order_ord_tfee;";
- DBContext.Execute(sql, new { accountId = _accountId, orderTimes });
- sql = @"UPDATE tk_report
- SET order_ord_num = order_ord_num_3 + order_ord_num_12 + order_ord_num_13 + order_ord_num_14
- WHERE DATE(report_date) IN @orderTimes AND accountId=@accountId;";
- DBContext.Execute(sql, new { accountId = _accountId, orderTimes });
- return total;
- }
- public async Task<int> GetOrdersByAdZoneAsync(long adzoneId, DateTime startTime, DateTime endTime, int sleep)
- {
- string cacheKey = $":cache:GetOrdersByAdZone:{_accountName}";
- string cacheKey2 = $":cache:GetOrdersByAdZone:{_accountId}";
- DateTime last_modifiedTime = RedisHelper.Get<DateTime>(cacheKey);
- if (last_modifiedTime != DateTime.MinValue)
- {
- startTime = last_modifiedTime;
- }
- else
- {
- last_modifiedTime = startTime;
- }
- //当日往前查询
- (int total, DateTime max_modifiedTime, List<DateTime> orderTimes) = await GetTkOrdersByAdZoneAsync(adzoneId, startTime, endTime, last_modifiedTime, true, sleep);
- if (max_modifiedTime != DateTime.MinValue)
- {
- RedisHelper.Set(cacheKey, max_modifiedTime);
- RedisHelper.Set(cacheKey2, max_modifiedTime);
- }
- return total;
- }
- public async Task<(int, DateTime, List<DateTime>)> GetTkOrdersByAdZoneAsync(long adzoneId, DateTime startTime, DateTime endTime, DateTime last_modifiedTime, bool desc = true, int sleep = 100)
- {
- List<DateTime> orderTimes = [];
- if (startTime > endTime)
- {
- (startTime, endTime) = (endTime, startTime);
- }
- DateTime max_modifiedTime = last_modifiedTime;
- int pageNo = 1;
- string positionIndex = string.Empty;
- int pageSize = 100;
- bool hasNext = true;
- int total = 0;
- while (hasNext)
- {
- var ts = DateTime.Now.Convert2UnixTimestamp(true);
- string jumpType = pageNo == 1 ? "0" : "1";
- #if DEBUG
- jumpType = pageNo == 1 ? "0" : "1";
- #endif
- string queryType = desc ? "4" : "2";
- string url = $"{base_orders_url}?t={ts}&_tb_token_={_tb_token}&pageNo={pageNo}&pageSize={pageSize}&startTime={startTime:yyyy-MM-dd}&endTime={endTime:yyyy-MM-dd}&payStatus=&queryType={queryType}&jumpType={jumpType}&tkTradeId=&positionIndex={positionIndex.UrlEncode()}";
- string body = "";
- JsonElement data;
- try
- {
- for (var i = 1; i <= 5; i++)
- {
- var client = new WebClientUtility().SetContentType("application/json;charset=utf-8")
- .AddHeaders("X-Requested-With", "XMLHttpRequest")
- .AddHeaders("Cookie", _cookies);
- #if DEBUG
- #else
- client.Proxy = _proxy;
- #endif
- if (!string.IsNullOrEmpty(_user_agent)) client.UserAgent = _user_agent;
- var response = client.Request(url);
- if (response.ResponseException != null)
- {
- _ = new LoggerLibrary("api_error", "fail")
- .Info(response.ResponseException.Message, response.ResponseException.StackTrace)
- .SaveAsync();
- throw response.ResponseException;
- }
- body = response.Body();
- #if DEBUG
- _ = new LoggerLibrary("debug", "GetTkOrdersByAdZone")
- .Info(body)
- .SaveAsync();
- #endif
- if (body.Contains("{\"action\":\"captcha\""))
- {
- string message = $"【GetTkOrdersByAdZone】【{_accountId}:{_accountName}】第 {i} 次出现滑动验证码";
- NotifyCore.Notify(new NifyMessage
- {
- message = message,
- priority = NifyMessagePriority.high,
- tags = ["red_circle"]
- });
- if (!_account.is_hide)
- {
- _ = NotifyCore.QYWeixinPushNotifyAsync("GetTkOrders【出现滑动验证码】", message);
- }
- await Task.Delay(i * 60 * 1000);
- continue;
- }
- if (body.Contains("\"resultCode\":500"))
- {
- string message = $"【GetTkOrdersByAdZone】【{_accountId}:{_accountName}】第 {i} 次出现错误\n{body}";
- NotifyCore.Notify(new NifyMessage
- {
- message = message,
- priority = NifyMessagePriority.high,
- tags = ["red_circle"]
- });
- await Task.Delay(i * 60 * 1000);
- continue;
- }
- break;
- }
- var root = body.Convert2JsonElement();
- var success = root.Read<bool>("success");
- data = root.ElementRead("data");
- if (!success && body.Contains("nologin"))
- {
- (success, string message) = RenewCookie();
- if (!success)
- {
- TkPoolCore.Disabled(_accountId, _accountName, $"{body}", _account.is_hide);
- }
- return (0, DateTime.MinValue, new List<DateTime>());
- }
- if (!success)
- {
- throw new APIException(body);
- }
- }
- catch (Exception ex)
- {
- throw new APIException(body);
- }
- using var conn = DBContext.GetOpenConnection();
- conn.Open();
- try
- {
- foreach (var order in data.ElementRead("result").EnumerateArray())
- {
- TkOrderDetailAdZoneDTO item = order.GetRawText().Convert2Object<TkOrderDetailAdZoneDTO>();
- // 处理每个订单数据
- if (item.adzoneId != adzoneId) continue;
- item.accountId = _accountId;
- item.accountName = _company;
- if (item.modifiedTime > max_modifiedTime) max_modifiedTime = item.modifiedTime;
- if (last_modifiedTime != DateTime.MinValue && last_modifiedTime >= item.modifiedTime)
- {
- return (total, max_modifiedTime, orderTimes);
- }
- if (item.tkStatus == 3 && item.tbPaidTime != DateTime.MinValue) orderTimes.Add(item.tbPaidTime.Date);
- int? id = conn.Replace(item);
- total++;
- }
- }
- catch (Exception ex)
- {
- throw;
- }
- finally
- {
- conn.Dispose();
- }
- pageNo++;
- hasNext = data.Read<bool>("hasNext");
- positionIndex = data.Read<string>("positionIndex");
- if (sleep > 0) await Task.Delay(sleep);
- }
- return (total, max_modifiedTime, orderTimes);
- }
- public async Task<(int, DateTime, List<DateTime>)> GetTkOrdersAsync(DateTime startTime, DateTime endTime, DateTime last_modifiedTime, bool desc = true, int sleep = 100)
- {
- List<DateTime> orderTimes = [];
- // 确保 startTime 小于 endTime
- if (startTime > endTime)
- {
- (startTime, endTime) = (endTime, startTime);
- }
- DateTime max_modifiedTime = last_modifiedTime;
- int pageNo = 1;
- string positionIndex = string.Empty;
- int pageSize = 100;
- bool hasNext = true;
- int total = 0;
- while (hasNext)
- {
- var ts = DateTime.Now.Convert2UnixTimestamp(true);
- //string jumpType = desc ? pageNo == 1 ? "0" : "1" : "-1";
- string jumpType = pageNo == 1 ? "0" : "1";
- #if DEBUG
- jumpType = pageNo == 1 ? "0" : "1";
- #endif
- //string queryType = "1";
- //1 创建时间;3结算时间 2付款时间 4更新时间
- //string queryType = "2";
- string queryType = desc ? "4" : "2";
- string url = $"{base_orders_url}?t={ts}&_tb_token_={_tb_token}&pageNo={pageNo}&pageSize={pageSize}&startTime={startTime:yyyy-MM-dd}&endTime={endTime:yyyy-MM-dd}&payStatus=&queryType={queryType}&jumpType={jumpType}&tkTradeId=&positionIndex={positionIndex.UrlEncode()}";
- //https://pub.alimama.com/openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json?t=1719477837298&_tb_token_=7537e7ed93338&pageNo=92&pageSize=20&startTime=2024-03-31&endTime=2024-03-31&payStatus=&queryType=2&jumpType=1&tkTradeId=&positionIndex=1711883373_2vtPPr7CyYX2%7C1711883522_4zcICUeUevh2
- //https://pub.alimama.com/openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json?t=1719477942492&_tb_token_=7537e7ed93338&pageNo=7&pageSize=20&startTime=2024-03-31&endTime=2024-03-31&payStatus=&queryType=2&jumpType=1&tkTradeId=&positionIndex=1711899163_4zdpOH1mbTQ2%7C1711899483_4zbH9BHqgl82
- string body = "";
- JsonElement data;
- try
- {
- bool success = false;
- for (var i = 1; i <= 5; i++)
- {
- var client = new WebClientUtility().SetContentType("application/json;charset=utf-8")
- .AddHeaders("X-Requested-With", "XMLHttpRequest")
- .AddHeaders("Cookie", _cookies);
- #if DEBUG
- #else
- client.Proxy = _proxy;
- #endif
- if (!string.IsNullOrEmpty(_user_agent)) client.UserAgent = _user_agent;
- var response = client.Request(url);
- if (response.ResponseException != null)
- {
- _ = new LoggerLibrary("api_error", "fail")
- .Info(response.ResponseException.Message, response.ResponseException.StackTrace)
- .SaveAsync();
- throw response.ResponseException;
- }
- body = response.Body();
- _ = new LoggerLibrary("debug", "GetTkOrders")
- .Info(body)
- .SaveAsync();
- #if DEBUG
- body = "<a id=\"a-link\"></a>\r\n<script>\r\n localStorage.x5referer = \"https://pub.alimama.com/openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json?t=1753926991809&_tb_token_=63a173be-1d48-4b35-9365-c9e88d80bd22&pageNo=1&pageSize=100&startTime=2025-07-31&endTime=2025-07-31&payStatus=&queryType=4&jumpType=0&tkTradeId=&positionIndex=\";\t\r\n var link = document.getElementById(\"a-link\");\r\n var isMobile = navigator.userAgent.match(/.*(iPhone|iPad|Android|ios|SymbianOS|Windows Phone).*/i);\r\n var host = isMobile ? \"https://login.m.taobao.com/login.htm?from=sm&ttid=h5@iframe&redirectURL=\" : \"https://login.taobao.com/member/login.jhtml?redirectURL=\";\r\n try {\r\n\tvar hostValue = window.location.host;\r\n\tvar parts = hostValue && hostValue.split('.');\r\n\tvar exp = new Date();\r\n\tvar maxAge = -100;\r\n\texp.setTime(exp.getTime() + maxAge);\r\n\tvar cookie = 'x5secdata=;maxAge=' + maxAge + ';expires=' + exp.toUTCString() + ';path=/;domain=.' + parts.slice(-2).join('.') + ';';\r\n\tdocument.cookie = cookie;\r\n\tdocument.cookie = cookie + 'Secure;SameSite=None';\r\n } catch(e) {}\r\n link.href = host + \"https%3a%2f%2fpub.alimama.com:443/openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json%2F_____tmd_____%2Fpage%2Flogin_jump%3Frand%3DS3WxGHAgAt756EpznwfNzJq2AFA2qBNla3j6EINUS8We9dazM_iKElp8DwVSHZUevpC41Bx7RzivXIj9RnZgdg%26_lgt_%3Db3cd621c481534716e8a6746557d7819___315550___5c0b95bde5166ee3786b77616fa971f7___eaebc79cac1eb5d2f7d8b4595e00ec73344a42d5a0b8cf56539c823cd24ac06c20ec1211b42711a826d58cd8cc1119e8aeead8c3f9de63d3f506b5ed39a5726cb02971d4a9f502dbbd27c123102f3e837a98f6e85580eaccf7dc1693a9bfecc80fa5a006f894296684ae17bbd0aade11384dbaad7a6f2f5737085962fcc5af80ade51d97d2e647bab64fddca4d953edcddcdd4efcab95bde0aac94906316beed64dfc0747a2c2bccdd8dd524cefc683b5028ae43f400dfe7a9e046153cc6fc64915ffee67e86ab66ccfcc8264300c5965152ff3956aba31cae08472d1a4d65c3eafcd446c082ebfc155e4340468745122140eb8fe5a81dc799be2cb689849e0cdafb6de28903c5fe87717cf30f66324d86d4e68d65d250200d2d0f7a91452e483d4a43213597d5e2249ec2536825bd75918316a8d62033b9ebf7b284e2a36b48&uuid=b3cd621c481534716e8a6746557d7819\";\r\n link.click();\r\n window._config_ = {\r\n \"action\": \"login\",\r\n \"url\": \"https://login.taobao.com/member/login.jhtml?style=mini&newMini2=true&from=sm&full_redirect=false&redirectURL=https%3a%2f%2fpub.alimama.com:443/openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json%2F_____tmd_____%2Fpage%2Fclose_iframe_page%3Frand%3DS3WxGHAgAt756EpznwfNzJq2AFA2qBNla3j6EINUS8We9dazM_iKElp8DwVSHZUevpC41Bx7RzivXIj9RnZgdg%26uuid%3Db3cd621c481534716e8a6746557d7819%26_lgt_%3Db3cd621c481534716e8a6746557d7819___315550___5c0b95bde5166ee3786b77616fa971f7___eaebc79cac1eb5d2f7d8b4595e00ec73344a42d5a0b8cf56539c823cd24ac06c20ec1211b42711a826d58cd8cc1119e8aeead8c3f9de63d3f506b5ed39a5726cb02971d4a9f502dbbd27c123102f3e837a98f6e85580eaccf7dc1693a9bfecc80fa5a006f894296684ae17bbd0aade11384dbaad7a6f2f5737085962fcc5af80ade51d97d2e647bab64fddca4d953edcddcdd4efcab95bde0aac94906316beed64dfc0747a2c2bccdd8dd524cefc683b5028ae43f400dfe7a9e046153cc6fc64915ffee67e86ab66ccfcc8264300c5965152ff3956aba31cae08472d1a4d65c3eafcd446c082ebfc155e4340468745122140eb8fe5a81dc799be2cb689849e0cdafb6de28903c5fe87717cf30f66324d86d4e68d65d250200d2d0f7a91452e483d4a43213597d5e2249ec2536825bd75918316a8d62033b9ebf7b284e2a36b48\",\r\n \"h5url\": \"https://login.m.taobao.com/login.htm?from=sm&ttid=h5@iframe&redirectURL=https%3a%2f%2fpub.alimama.com:443/openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json%2F_____tmd_____%2Fpage%2Fclose_iframe_page%3Frand%3DS3WxGHAgAt756EpznwfNzJq2AFA2qBNla3j6EINUS8We9dazM_iKElp8DwVSHZUevpC41Bx7RzivXIj9RnZgdg%26uuid%3Db3cd621c481534716e8a6746557d7819%26_lgt_%3Db3cd621c481534716e8a6746557d7819___315550___5c0b95bde5166ee3786b77616fa971f7___eaebc79cac1eb5d2f7d8b4595e00ec73344a42d5a0b8cf56539c823cd24ac06c20ec1211b42711a826d58cd8cc1119e8aeead8c3f9de63d3f506b5ed39a5726cb02971d4a9f502dbbd27c123102f3e837a98f6e85580eaccf7dc1693a9bfecc80fa5a006f894296684ae17bbd0aade11384dbaad7a6f2f5737085962fcc5af80ade51d97d2e647bab64fddca4d953edcddcdd4efcab95bde0aac94906316beed64dfc0747a2c2bccdd8dd524cefc683b5028ae43f400dfe7a9e046153cc6fc64915ffee67e86ab66ccfcc8264300c5965152ff3956aba31cae08472d1a4d65c3eafcd446c082ebfc155e4340468745122140eb8fe5a81dc799be2cb689849e0cdafb6de28903c5fe87717cf30f66324d86d4e68d65d250200d2d0f7a91452e483d4a43213597d5e2249ec2536825bd75918316a8d62033b9ebf7b284e2a36b48\",\r\n \"dialogSize\": {\"width\": \"\", \"height\": \"\"}\r\n};\r\n</script>\r\n<!--rgv587_flag:sm-->\r\n2025-07-31 09:56:31.854\t\r\n<a id=\"a-link\"></a>\r\n<script>\r\n localStorage.x5referer = \"https://pub.alimama.com/openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json?t=1753926991809&_tb_token_=63a173be-1d48-4b35-9365-c9e88d80bd22&pageNo=1&pageSize=100&startTime=2025-07-31&endTime=2025-07-31&payStatus=&queryType=4&jumpType=0&tkTradeId=&positionIndex=\";\t\r\n var link = document.getElementById(\"a-link\");\r\n var isMobile = navigator.userAgent.match(/.*(iPhone|iPad|Android|ios|SymbianOS|Windows Phone).*/i);\r\n var host = isMobile ? \"https://login.m.taobao.com/login.htm?from=sm&ttid=h5@iframe&redirectURL=\" : \"https://login.taobao.com/member/login.jhtml?redirectURL=\";\r\n try {\r\n\tvar hostValue = window.location.host;\r\n\tvar parts = hostValue && hostValue.split('.');\r\n\tvar exp = new Date();\r\n\tvar maxAge = -100;\r\n\texp.setTime(exp.getTime() + maxAge);\r\n\tvar cookie = 'x5secdata=;maxAge=' + maxAge + ';expires=' + exp.toUTCString() + ';path=/;domain=.' + parts.slice(-2).join('.') + ';';\r\n\tdocument.cookie = cookie;\r\n\tdocument.cookie = cookie + 'Secure;SameSite=None';\r\n } catch(e) {}\r\n link.href = host + \"https%3a%2f%2fpub.alimama.com:443/openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json%2F_____tmd_____%2Fpage%2Flogin_jump%3Frand%3DS3WxGHAgAt756EpznwfNzJq2AFA2qBNla3j6EINUS8We9dazM_iKElp8DwVSHZUevpC41Bx7RzivXIj9RnZgdg%26_lgt_%3Db3cd621c481534716e8a6746557d7819___315550___5c0b95bde5166ee3786b77616fa971f7___eaebc79cac1eb5d2f7d8b4595e00ec73344a42d5a0b8cf56539c823cd24ac06c20ec1211b42711a826d58cd8cc1119e8aeead8c3f9de63d3f506b5ed39a5726cb02971d4a9f502dbbd27c123102f3e837a98f6e85580eaccf7dc1693a9bfecc80fa5a006f894296684ae17bbd0aade11384dbaad7a6f2f5737085962fcc5af80ade51d97d2e647bab64fddca4d953edcddcdd4efcab95bde0aac94906316beed64dfc0747a2c2bccdd8dd524cefc683b5028ae43f400dfe7a9e046153cc6fc64915ffee67e86ab66ccfcc8264300c5965152ff3956aba31cae08472d1a4d65c3eafcd446c082ebfc155e4340468745122140eb8fe5a81dc799be2cb689849e0cdafb6de28903c5fe87717cf30f66324d86d4e68d65d250200d2d0f7a91452e483d4a43213597d5e2249ec2536825bd75918316a8d62033b9ebf7b284e2a36b48&uuid=b3cd621c481534716e8a6746557d7819\";\r\n link.click();\r\n window._config_ = {\r\n \"action\": \"login\",\r\n \"url\": \"https://login.taobao.com/member/login.jhtml?style=mini&newMini2=true&from=sm&full_redirect=false&redirectURL=https%3a%2f%2fpub.alimama.com:443/openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json%2F_____tmd_____%2Fpage%2Fclose_iframe_page%3Frand%3DS3WxGHAgAt756EpznwfNzJq2AFA2qBNla3j6EINUS8We9dazM_iKElp8DwVSHZUevpC41Bx7RzivXIj9RnZgdg%26uuid%3Db3cd621c481534716e8a6746557d7819%26_lgt_%3Db3cd621c481534716e8a6746557d7819___315550___5c0b95bde5166ee3786b77616fa971f7___eaebc79cac1eb5d2f7d8b4595e00ec73344a42d5a0b8cf56539c823cd24ac06c20ec1211b42711a826d58cd8cc1119e8aeead8c3f9de63d3f506b5ed39a5726cb02971d4a9f502dbbd27c123102f3e837a98f6e85580eaccf7dc1693a9bfecc80fa5a006f894296684ae17bbd0aade11384dbaad7a6f2f5737085962fcc5af80ade51d97d2e647bab64fddca4d953edcddcdd4efcab95bde0aac94906316beed64dfc0747a2c2bccdd8dd524cefc683b5028ae43f400dfe7a9e046153cc6fc64915ffee67e86ab66ccfcc8264300c5965152ff3956aba31cae08472d1a4d65c3eafcd446c082ebfc155e4340468745122140eb8fe5a81dc799be2cb689849e0cdafb6de28903c5fe87717cf30f66324d86d4e68d65d250200d2d0f7a91452e483d4a43213597d5e2249ec2536825bd75918316a8d62033b9ebf7b284e2a36b48\",\r\n \"h5url\": \"https://login.m.taobao.com/login.htm?from=sm&ttid=h5@iframe&redirectURL=https%3a%2f%2fpub.alimama.com:443/openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json%2F_____tmd_____%2Fpage%2Fclose_iframe_page%3Frand%3DS3WxGHAgAt756EpznwfNzJq2AFA2qBNla3j6EINUS8We9dazM_iKElp8DwVSHZUevpC41Bx7RzivXIj9RnZgdg%26uuid%3Db3cd621c481534716e8a6746557d7819%26_lgt_%3Db3cd621c481534716e8a6746557d7819___315550___5c0b95bde5166ee3786b77616fa971f7___eaebc79cac1eb5d2f7d8b4595e00ec73344a42d5a0b8cf56539c823cd24ac06c20ec1211b42711a826d58cd8cc1119e8aeead8c3f9de63d3f506b5ed39a5726cb02971d4a9f502dbbd27c123102f3e837a98f6e85580eaccf7dc1693a9bfecc80fa5a006f894296684ae17bbd0aade11384dbaad7a6f2f5737085962fcc5af80ade51d97d2e647bab64fddca4d953edcddcdd4efcab95bde0aac94906316beed64dfc0747a2c2bccdd8dd524cefc683b5028ae43f400dfe7a9e046153cc6fc64915ffee67e86ab66ccfcc8264300c5965152ff3956aba31cae08472d1a4d65c3eafcd446c082ebfc155e4340468745122140eb8fe5a81dc799be2cb689849e0cdafb6de28903c5fe87717cf30f66324d86d4e68d65d250200d2d0f7a91452e483d4a43213597d5e2249ec2536825bd75918316a8d62033b9ebf7b284e2a36b48\",\r\n \"dialogSize\": {\"width\": \"\", \"height\": \"\"}\r\n};\r\n</script>\r\n<!--rgv587_flag:sm-->";
- #endif
- if (body.Contains("{\"action\":\"login\"") || body.Contains("\"action\": \"login\""))
- {
- (success, string message) = RenewCookie();
- if (!success)
- {
- TkPoolCore.Disabled(_accountId, _accountName, $"{body}", _account.is_hide);
- }
- return (0, DateTime.MinValue, new List<DateTime>());
- }
- if (body.Contains("{\"action\":\"captcha\""))
- {
- string message = $"【GetTkOrders】【{_accountId}:{_accountName}】第 {i} 次出现滑动验证码";
- NotifyCore.Notify(new NifyMessage
- {
- message = message,
- priority = NifyMessagePriority.high,
- tags = ["red_circle"]
- });
- if (!_account.is_hide)
- {
- _ = NotifyCore.QYWeixinPushNotifyAsync("GetTkOrders【出现滑动验证码】", message);
- }
- await Task.Delay(i * 60 * 1000);
- continue;
- }
- if (body.Contains("\"resultCode\":500"))
- {
- //{"success":false,"resultCode":500,"bizErrorDesc":"系统繁忙,请稍后重试!","bizErrorCode":3001}
- string message = $"【GetTkOrders】【{_accountId}:{_accountName}】第 {i} 次出现错误\n{body}";
- NotifyCore.Notify(new NifyMessage
- {
- message = message,
- priority = NifyMessagePriority.high,
- tags = ["red_circle"]
- });
- await Task.Delay(i * 60 * 1000);
- continue;
- }
- break;
- }
- /*
- <script>sessionStorage.x5referer = window.location.href;var url = window.location.protocol + "//pub.alimama.com//openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json/_____tmd_____/punish?x5secdata=xc1iwR0XfHknuQ2tGhtadtTAvEt14YScfTDHt2ZiSRqroaYZK98uykgsVOy7o75Rw8uuycKT3Rpx30%2fB5H0gRc0%2fJVGQUcV5g%2fsAmZ%2bc46eyD7DXSdA4R3mLnmtbp9wuZ1vmrG3ZPlH7brUilFbXBdZ7EBrru1X7wPfC05Eq3g4mhDFiGq39xUtwQcC%2f%2bPbtekcm8%2fVJ%2brVt8aExunwzXzJPJJTAvEt14YScfTDHt2ZiSRqroaYZK98uykgsiXIkw%2ffMWwebJ3zxCja5CzSu%2ffTA%3d%3d__bx__pub.alimama.com%2fopenapi%2fparam2%2f1%2fgateway.unionpub%2freport.getTbkOrderDetails.json&x5step=1";window.location.replace(url);window._config_ = {"action":"captcha","url":"https://pub.alimama.com//openapi/param2/1/gateway.unionpub/report.getTbkOrderDetails.json/_____tmd_____/punish?x5secdata=xc1iwR0XfHknuQ2tGhtadtTAvEt14YScfTDHt2ZiSRqroaYZK98uykgsVOy7o75Rw8uuycKT3Rpx30%2fB5H0gRc0%2fJVGQUcV5g%2fsAmZ%2bc46eyD7DXSdA4R3mLnmtbp9wuZ1vmrG3ZPlH7brUilFbXBdZ7EBrru1X7wPfC05Eq3g4mhDFiGq39xUtwQcC%2f%2bPbtekcm8%2fVJ%2brVt8aExunwzXzJPJJTAvEt14YScfTDHt2ZiSRqroaYZK98uykgsiXIkw%2ffMWwebJ3zxCja5CzSu%2ffTA%3d%3d__bx__pub.alimama.com%2fopenapi%2fparam2%2f1%2fgateway.unionpub%2freport.getTbkOrderDetails.json&x5step=1"};</script><!--rgv587_flag:sm--> */
- var root = body.Convert2JsonElement();
- success = root.Read<bool>("success");
- data = root.ElementRead("data");
- //{"code":601,"info":{"ok":false,"message":"nologin"}}
- if (!success && body.Contains("nologin"))
- {
- (success, string message) = RenewCookie();
- if (!success)
- {
- TkPoolCore.Disabled(_accountId, _accountName, $"{body}", _account.is_hide);
- }
- return (0, DateTime.MinValue, new List<DateTime>());
- }
- if (!success)
- {
- throw new APIException(body);
- }
- }
- catch (Exception ex)
- {
- _ = new LoggerLibrary("debug", "GetTkOrders")
- .Info(body)
- .Info(ex.Message, ex.StackTrace)
- .SaveAsync();
- string message = $"【GetRawItemId】{_accountId}:{_accountName}\t{_proxy?.Address}\n" +
- $"{body}\n{ex.Message}\n{ex.StackTrace}";
- if (sleep > 0) await Task.Delay(sleep);
- throw new APIException(body);
- }
- try
- {
- foreach (var order in data.ElementRead("result").EnumerateArray())
- {
- TkOrderDetailDTO item = order.GetRawText().Convert2Object<TkOrderDetailDTO>();
- // 处理每个订单数据
- item.accountId = _accountId;
- item.accountName = _company;
- if (item.modifiedTime > max_modifiedTime) max_modifiedTime = item.modifiedTime;
- if (last_modifiedTime != DateTime.MinValue && last_modifiedTime >= item.modifiedTime)
- {
- return (total, max_modifiedTime, orderTimes);
- }
- //进行订单和转链匹配
- (int state, item.itemId) = GetRawItemId(item.mktId);
- if (item.tkStatus == 3 && item.tbPaidTime != DateTime.MinValue) orderTimes.Add(item.tbPaidTime.Date);
- using var conn = DBContext.GetOpenConnection();
- int? id = conn.Replace(item);
- if (id != null)
- {
- item.id = (int)id;
- TkOrderTrackingCore.MatchOrder(_account, item);
- }
- total++;
- }
- }
- catch (Exception ex)
- {
- if (sleep > 0) await Task.Delay(sleep);
- throw;
- }
- pageNo++;
- hasNext = data.Read<bool>("hasNext");
- positionIndex = data.Read<string>("positionIndex");
- if (sleep > 0) await Task.Delay(sleep);
- }
- return (total, max_modifiedTime, orderTimes);
- }
- public (int, string) GetRawItemId(string mktId)
- {
- ////
- ///
- string body = string.Empty, location = string.Empty;
- var proxy = ProxyNodesCore.RandomOne();
- try
- {
- string cacheKey = $":cache:mkt2itemId:{mktId}";
- string itemId = RedisHelper.Get(cacheKey);
- if (itemId != null) return (1, itemId);
- string mktItemLink = $"https://uland.taobao.com/item/edetail?id={mktId}";
- ////uland.taobao.com/item/edetail?id=98t7UOZmNWX4dh2eJSQt6-b7Y8yZVuBQ5ywoz7TDA
- ////uland.taobao.com/item/edetail?id=98t7UOZmNWX4dh2eJSQt6-b7Y8yZVuBQ5ywoz7TD
- ///
- var client = new WebClientUtility();
- client.Proxy = proxy;
- client.AddHeaders("accept-language", "zh-CN,zh;q=0.9");
- client.AllowAutoRedirect = false;
- var response = client.Request(mktItemLink);
- if (!response.Successed)
- {
- throw response.ResponseException;
- }
- location = response.ResponseMessage?.Headers?.Location?.ToString();
- string message;
- if (!string.IsNullOrEmpty(location) && location.Contains("err.taobao.com/error1.html"))
- {
- message = $"【GetRawItemId】{_accountId}:{_accountName}\t{proxy?.Address}\n" +
- $"{mktId}\n{location}";
- //NotifyCore.Notify(new NifyMessage
- //{
- // message = message,
- // priority = NifyMessagePriority.high,
- // tags = ["red_circle"]
- //});
- return (0, null);
- }
- if (!string.IsNullOrEmpty(location) && location.Contains("item.htm?id="))
- {
- itemId = location.GetContentPart("?id=", "");
- }
- if (!string.IsNullOrEmpty(itemId))
- {
- RedisHelper.Set(cacheKey, itemId, 86400 * 7);
- }
- else
- {
- }
- return (1, itemId);
- }
- catch (Exception ex)
- {
- string message = $"【GetRawItemId】{_accountId}:{_accountName}\t{proxy?.Address}\n" +
- $"{mktId}\n{location}\n{body}\n{ex.Message}";
- NotifyCore.Notify(new NifyMessage
- {
- message = message,
- priority = NifyMessagePriority.high,
- tags = ["red_circle"]
- });
- }
- return (0, null);
- }
- public (int, string) GetRawItemId22(string mktId)
- {
- string body = string.Empty, location = string.Empty;
- try
- {
- string lock_key = $"lock:GetRawItemId:disabled";
- int count = RedisHelper.Get<int>(lock_key);
- if (count > 0) return (0, null);
- string cacheKey = $":cache:mkt2itemId:{mktId}";
- string itemId = RedisHelper.Get(cacheKey);
- if (itemId != null) return (1, itemId);
- var ts = DateTime.Now.Convert2UnixTimestamp(true);
- string url = "https://pub.alimama.com/openapi/param2/1/gateway.unionpub/union.moose.content.entry";
- //string url = $"{base_orders_url}?t={ts}&_tb_token_={_tb_token}&pageNo={pageNo}&pageSize={pageSize}&startTime={startTime:yyyy-MM-dd}&endTime={endTime:yyyy-MM-dd}&payStatus=&queryType={queryType}&jumpType={jumpType}&tkTradeId=&positionIndex={positionIndex}";
- var client = new WebClientUtility()
- .SetContentType("application/x-www-form-urlencoded")
- .AddHeaders("Cookie", _cookies)
- .AddHeaders("Origin", "https://pub.alimama.com")
- .Post("_tb_token_", _tb_token)
- .Post("t", ts.ToString())
- .Post("bizType", "detailPage")
- .Post("bizParam", $"{{\"itemId\":\"{mktId}\"}}");
- //_tb_token_=3b88755bbe3f7&t=1718896771391&bizType=detailPage&bizParam=%7B%22itemId%22%3A%22JbtMUqkGMQvagTNb2Fvta-9ag242pu7MOX5e0bsrY%22%7D
- //_tb_token_=361e383eb61e5&t=1718895935097&bizType=detailPage&bizParam=%7B%22itemId%22%3A%22JbtMUqkGMQvagTNb2Fvta-9ag242pu7MOX5e0bsrY%22%7D
- #if DEBUG
- #else
- client.Proxy = _proxy;
- #endif
- if (!string.IsNullOrEmpty(_user_agent)) client.UserAgent = _user_agent;
- var response = client.Request(url);
- if (!response.Successed)
- {
- throw response.ResponseException;
- }
- location = response.ResponseMessage?.Headers?.Location?.ToString();
- string message;
- if (!string.IsNullOrEmpty(location) && location.Contains("err.taobao.com/error1.html"))
- {
- RedisHelper.Set(lock_key, 1, 60);
- message = $"【GetRawItemId】{_accountId}:{_accountName}\t{_proxy?.Address}\n" +
- $"{mktId}\n{location}";
- //NotifyCore.Notify(new NifyMessage
- //{
- // message = message,
- // priority = NifyMessagePriority.high,
- // tags = ["red_circle"]
- //});
- return (0, null);
- }
- body = response.Body();
- var root = body.Convert2JsonElement();
- int code = root.PathRead<int>("code");
- message = root.PathRead<string>("info.message");
- //if ("nologin".Equals(message))
- //{
- // (bool success, message) = RenewCookie();
- // if (!success)
- // {
- // TkPoolCore.Disabled(_accountId, _accountName, body);
- // throw new Exception("nologin");
- // }
- // return (-1, null);
- //}
- itemId = root.PathRead<string>("model.item.itemId");
- if (!string.IsNullOrEmpty(itemId))
- {
- RedisHelper.Set(cacheKey, itemId, 86400 * 7);
- }
- else
- {
- //RedisHelper.Set(lock_key, 1, 3600);
- }
- return (1, itemId);
- }
- catch (Exception ex)
- {
- string message = $"【GetRawItemId】{_accountId}:{_accountName}\t{_proxy?.Address}\n" +
- $"{mktId}\n{location}\n{body}\n{ex.Message}";
- NotifyCore.Notify(new NifyMessage
- {
- message = message,
- priority = NifyMessagePriority.high,
- tags = ["red_circle"]
- });
- }
- return (0, null);
- }
- public void GetTkOrders222()
- {
- try
- {
- string url = "https://media.alimama.com/violationu2/warning_instance_page_v2.json?r=mx_208&toPage=1&pageSize=40¶ms=";
- var client = new WebClientUtility().SetContentType("application/json;charset=utf-8")
- .AddHeaders("X-Requested-With", "XMLHttpRequest")
- .AddHeaders("Cookie", _cookies);
- client.Proxy = _proxy;
- if (!string.IsNullOrEmpty(_user_agent)) client.UserAgent = _user_agent;
- var response = client.Request(url);
- var body = response.Body();
- var root = body.Convert2JsonElement();
- int resultCode = root.Read<int>("resultCode", 0);
- int totalCount = root.PathRead<int>("data.totalCount", 0);
- bool success = root.Read("success", false);
- if (!success)
- {
- _ = new LoggerLibrary("violationu", "warning_error")
- .Info(url, body)
- .SaveAsync();
- throw new Exception(body);
- }
- if (totalCount == 0) return;
- _ = new LoggerLibrary("violationu", "warning").Info(url, body).SaveAsync();
- var list = root.ElementRead("data").ElementRead("result").EnumerateArray();
- foreach (var data in list)
- {
- var violation_commission = data.PathRead<decimal>("mediaInfo.订单虚假交易违规佣金", 0);
- new DBContext.Table("alimama_warning")
- .Fill(data)
- .Loader<int>("filterRuleId", 0)
- .Loader<long>("gmtCreate", 0)
- .Loader<long>("id", 0, "ali_id")
- .Loader<string>("idStr", string.Empty)
- .Loader<int>("mediaDimension", 0)
- .Loader<long>("mediaId", 0)
- .Loader<int>("mediaInfo.abn_cnt", 0, "abn_cnt")
- .Add("violation_commission", violation_commission)
- .Loader<int>("mediaInfo.warning_cnt", 0, "warning_cnt")
- .Loader<string>("mediaName", string.Empty)
- .Loader<long>("memberId", 0)
- .Loader<string>("noticeCategory", string.Empty)
- .Loader<int>("noticeTemplateId", 0)
- .Loader<string>("noticeTemplateName", string.Empty)
- .Loader<string>("orderFile", string.Empty)
- .Loader<string>("pid", string.Empty)
- .Loader<int>("punishRuleId", 0)
- .Loader<string>("riskType", string.Empty)
- .Loader<string>("roleName", string.Empty)
- .Loader<string>("ruleLink", string.Empty)
- .Loader<bool>("showOrderDetail", false)
- .Loader<int>("status", 0, "ali_status")
- .Loader<string>("warningText", string.Empty)
- .Add("accountName", _accountName)
- .Add("status", true)
- .Add("create_time", DateTime.Now)
- .Add("last_time", DateTime.Now)
- .Create(DBContext.InsertType.REPLACE);
- }
- }
- catch (Exception ex) { }
- }
- }
- }
|