Commit b4c1716a authored by 任国军's avatar 任国军

add has_address

parent 541614c1
Pipeline #27197 passed with stage
in 5 seconds
...@@ -36,6 +36,7 @@ module.exports = app => { ...@@ -36,6 +36,7 @@ module.exports = app => {
pay_url: STRING, pay_url: STRING,
sub_title: STRING, sub_title: STRING,
pay_count: INTEGER, pay_count: INTEGER,
has_address: INTEGER,
sort: INTEGER, sort: INTEGER,
status: INTEGER, status: INTEGER,
is_deleted: INTEGER, is_deleted: INTEGER,
......
...@@ -111,7 +111,7 @@ class InstitutionSubService extends Service { ...@@ -111,7 +111,7 @@ class InstitutionSubService extends Service {
// 课程详情 // 课程详情
async getClassInfo(id) { async getClassInfo(id) {
const { ctx } = this; const { ctx } = this;
const attributes = [ 'id', 'institution_id', 'name', 'logo', 'age', 'price', 'price_type', 'mode', 'time', 'class_amount', 'multi_classes', 'cycle', 'description', 'button_style', 'button_text', 'button_type', 'button_sub_text', 'button_url', 'button_pay_text', 'top_price', 'pay_price', 'sub_title', 'pay_count', 'sort', 'pay_url' ]; const attributes = [ 'id', 'institution_id', 'name', 'logo', 'age', 'price', 'price_type', 'mode', 'time', 'class_amount', 'multi_classes', 'cycle', 'description', 'button_style', 'button_text', 'button_type', 'button_sub_text', 'button_url', 'button_pay_text', 'top_price', 'pay_price', 'sub_title', 'pay_count', 'sort', 'pay_url', 'has_address' ];
const classInfo = await ctx.classModel.V5.CourseV5Class.findOne({ where: { id, status: 1, is_deleted: 0 }, attributes, raw: true }); const classInfo = await ctx.classModel.V5.CourseV5Class.findOne({ where: { id, status: 1, is_deleted: 0 }, attributes, raw: true });
if (ctx.isEmpty(classInfo)) { if (ctx.isEmpty(classInfo)) {
ctx.failed('数据不存在'); ctx.failed('数据不存在');
......
...@@ -409,7 +409,7 @@ class UserService extends Service { ...@@ -409,7 +409,7 @@ class UserService extends Service {
class_id: id, class_id: id,
pay: classInfo.pay_price, pay: classInfo.pay_price,
type: 1, type: 1,
address: JSON.stringify(address), address,
columns: JSON.stringify(columns), columns: JSON.stringify(columns),
}; };
if (classInfo.button_type === 3) { if (classInfo.button_type === 3) {
...@@ -419,7 +419,7 @@ class UserService extends Service { ...@@ -419,7 +419,7 @@ class UserService extends Service {
order = await ctx.classModel.V5.CourseUserOrder.findOne({ where: { user_uuid: userUuid, class_id: id, is_deleted: 0 }, order: [[ 'id', 'asc' ]] }); order = await ctx.classModel.V5.CourseUserOrder.findOne({ where: { user_uuid: userUuid, class_id: id, is_deleted: 0 }, order: [[ 'id', 'asc' ]] });
} }
await ctx.classModel.V5.CourseUserOrder.update({ pay: classInfo.pay_price, order_no: orderNo, type: 1, address: JSON.stringify(address), columns: JSON.stringify(columns), status: 0 }, { where: { id: order.id } }); await ctx.classModel.V5.CourseUserOrder.update({ pay: classInfo.pay_price, order_no: orderNo, type: 1, address, columns: JSON.stringify(columns), status: 0 }, { where: { id: order.id } });
let response = await this.service.course.v5.wechat.pay({ pay: order.pay, order_no: orderNo, body: `趣选课-订单${orderNo}` }); let response = await this.service.course.v5.wechat.pay({ pay: order.pay, order_no: orderNo, body: `趣选课-订单${orderNo}` });
response = await ctx.helper.xmlTojson(response); response = await ctx.helper.xmlTojson(response);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment