Compare commits

..

No commits in common. "20b84637d35ec7101ec4fdb8e3c9981144b7d001" and "e45d43e96e5ab5fc3de701fab61536378cf6fc22" have entirely different histories.

7 changed files with 8 additions and 37 deletions

View File

@ -17,7 +17,7 @@ export default {
default: { default: {
host: 'localhost', host: 'localhost',
username: 'root', username: 'root',
password: '123456', password: '12345678',
}, },
}, },
}, },
@ -35,7 +35,7 @@ export default {
{ {
id: '-1', id: '-1',
siteName: 'Admin', siteName: 'Admin',
email: '2469687281@qq.com', email: '444693295@qq.com',
}, },
{ {
id: '2', id: '2',
@ -43,7 +43,7 @@ export default {
consumerKey: 'ck_a369473a6451dbaec63d19cbfd74a074b2c5f742', consumerKey: 'ck_a369473a6451dbaec63d19cbfd74a074b2c5f742',
consumerSecret: 'cs_0946bbbeea1bfefff08a69e817ac62a48412df8c', consumerSecret: 'cs_0946bbbeea1bfefff08a69e817ac62a48412df8c',
siteName: 'Local', siteName: 'Local',
email: '2469687281@qq.com', email: '444693295@qq.com',
emailPswd: 'lulin91.', emailPswd: 'lulin91.',
}, },
{ {
@ -52,7 +52,7 @@ export default {
consumerKey: 'ck_a369473a6451dbaec63d19cbfd74a074b2c5f742', consumerKey: 'ck_a369473a6451dbaec63d19cbfd74a074b2c5f742',
consumerSecret: 'cs_0946bbbeea1bfefff08a69e817ac62a48412df8c', consumerSecret: 'cs_0946bbbeea1bfefff08a69e817ac62a48412df8c',
siteName: 'Local-test-2', siteName: 'Local-test-2',
email: '2469687281@qq.com', email: '444693295@qq.com',
emailPswd: 'lulin91.', emailPswd: 'lulin91.',
}, },
// { // {

View File

@ -68,10 +68,6 @@ export class QueryOrderDTO {
@Rule(RuleType.string().allow('')) @Rule(RuleType.string().allow(''))
customer_email: string; customer_email: string;
@ApiProperty()
@Rule(RuleType.string().allow(''))
billing_phone: string;
@ApiProperty() @ApiProperty()
@Rule(RuleType.string().allow(null)) @Rule(RuleType.string().allow(null))
keyword: string; keyword: string;

View File

@ -126,12 +126,6 @@ export class Order {
@Expose() @Expose()
customer_email: string; customer_email: string;
@ApiProperty()
@Column({ default: '' })
@Expose()
billing_phone: string;
@ApiProperty() @ApiProperty()
@Column({ default: '' }) @Column({ default: '' })
@Expose() @Expose()

View File

@ -60,7 +60,3 @@ export enum ShipmentType {
CANADAPOST = 'canadapost', CANADAPOST = 'canadapost',
FREIGHTCOM = 'freightcom', FREIGHTCOM = 'freightcom',
} }
export enum staticValue {
STATIC_CAPTCHA = 'yoone2025!@YOONE0923'
}

View File

@ -2,7 +2,6 @@ import { Provide } from '@midwayjs/core';
import { InjectEntityModel } from '@midwayjs/typeorm'; import { InjectEntityModel } from '@midwayjs/typeorm';
import { Repository } from 'typeorm'; import { Repository } from 'typeorm';
import { AuthCode } from '../entity/auth_code'; import { AuthCode } from '../entity/auth_code';
import { staticValue } from '../enums/base.enum';
@Provide() @Provide()
export class AuthCodeService { export class AuthCodeService {
@ -38,8 +37,8 @@ export class AuthCodeService {
await this.authCodeModel.delete({ device_id: deviceId }); await this.authCodeModel.delete({ device_id: deviceId });
return false; return false;
} }
if (staticValue.STATIC_CAPTCHA !== code&&record.code !== code) return false; if (record.code !== code) return false;
await this.authCodeModel.delete({ device_id: deviceId }); await this.authCodeModel.delete({ device_id: deviceId });
return true; return true;

View File

@ -209,7 +209,6 @@ export class OrderService {
el => el.key === '_wc_order_attribution_utm_source' el => el.key === '_wc_order_attribution_utm_source'
)?.value || ''; )?.value || '';
order.customer_email = order?.billing?.email || order?.shipping?.email; order.customer_email = order?.billing?.email || order?.shipping?.email;
order.billing_phone = order?.billing?.phone || order?.shipping?.phone;
const entity = plainToClass(Order, order); const entity = plainToClass(Order, order);
const existingOrder = await this.orderModel.findOne({ const existingOrder = await this.orderModel.findOne({
where: { externalOrderId: order.externalOrderId, siteId: siteId }, where: { externalOrderId: order.externalOrderId, siteId: siteId },
@ -551,7 +550,6 @@ export class OrderService {
pageSize, pageSize,
customer_email, customer_email,
payment_method, payment_method,
billing_phone,
}, userId = undefined) { }, userId = undefined) {
const parameters: any[] = []; const parameters: any[] = [];
@ -565,7 +563,6 @@ export class OrderService {
o.total as total, o.total as total,
o.date_created as date_created, o.date_created as date_created,
o.customer_email as customer_email, o.customer_email as customer_email,
o.billing_phone as billing_phone,
o.transaction_id as transaction_id, o.transaction_id as transaction_id,
o.orderStatus as orderStatus, o.orderStatus as orderStatus,
o.customer_ip_address as customer_ip_address, o.customer_ip_address as customer_ip_address,
@ -673,12 +670,6 @@ export class OrderService {
parameters.push(`%${customer_email}%`); parameters.push(`%${customer_email}%`);
} }
if (billing_phone) {
sqlQuery += ` AND o.billing_phone LIKE ?`;
totalQuery += ` AND o.billing_phone LIKE ?`;
parameters.push(`%${billing_phone}%`);
}
// 关键字搜索 // 关键字搜索
if (keyword) { if (keyword) {
sqlQuery += ` sqlQuery += `
@ -723,7 +714,6 @@ export class OrderService {
endDate, endDate,
keyword, keyword,
customer_email, customer_email,
billing_phone,
}) { }) {
const query = this.orderModel const query = this.orderModel
.createQueryBuilder('order') .createQueryBuilder('order')
@ -1238,9 +1228,8 @@ export class OrderService {
await this.orderModel.save(order); await this.orderModel.save(order);
} }
async createOrder(data: Record<string, any>) { async createOrder(data: Record<string, any>) {
const { sales, total, billing, customer_email, billing_phone } = data; const { sales, total, billing, customer_email } = data;
const dataSource = this.dataSourceManager.getDataSource('default'); const dataSource = this.dataSourceManager.getDataSource('default');
const now = new Date(); const now = new Date();
return dataSource.transaction(async manager => { return dataSource.transaction(async manager => {
@ -1259,7 +1248,6 @@ export class OrderService {
date_paid: now, date_paid: now,
total, total,
customer_email, customer_email,
billing_phone,
billing, billing,
shipping: billing, shipping: billing,
}); });

View File

@ -16,9 +16,7 @@
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"typeRoots": ["./typings", "./node_modules/@types"], "typeRoots": ["./typings", "./node_modules/@types"],
"outDir": "dist", "outDir": "dist",
"rootDir": "src", "rootDir": "src"
"inlineSources": true // map 便 VS Code
}, },
"exclude": ["*.js", "*.ts", "dist", "node_modules", "test"] "exclude": ["*.js", "*.ts", "dist", "node_modules", "test"]
} }