- use skuName price as unit price for storesku.

This commit is contained in:
gazebo
2018-09-26 12:18:59 +08:00
parent 7499018f11
commit ba680cdf8e
4 changed files with 87 additions and 20 deletions

View File

@@ -173,10 +173,10 @@ func GetStoreSkus(storeID int, isFocused bool, keyword string, params map[string
t1.img,
t1.elm_img_hash_code,
CONCAT("[", GROUP_CONCAT(DISTINCT CONCAT('{"id":', t2.id, ',"status":', t2.status, ',"createdAt":"',
CONCAT(REPLACE(t4.created_at," ","T"),"+08:00"), '","updatedAt":"', CONCAT(REPLACE(t4.updated_at," ","T"),"+08:00"),
'","lastOperator":"', t4.last_operator, '","specQuality":', t2.spec_quality, ',"specUnit":"', t2.spec_unit, '","weight":', t2.weight,
CONCAT(REPLACE(IF(t4.created_at IS NULL, '1970-01-01 00:00:00', t4.created_at)," ","T"),"+08:00"), '","updatedAt":"', CONCAT(REPLACE(IF(t4.updated_at IS NULL, '1970-01-01 00:00:00', t4.updated_at)," ","T"),"+08:00"),
'","lastOperator":"', IF(t4.last_operator IS NULL, '', t4.last_operator), '","specQuality":', t2.spec_quality, ',"specUnit":"', t2.spec_unit, '","weight":', t2.weight,
',"jdID":', t2.jd_id, ',"categoryID":', t2.category_id, ',"nameID":', t2.name_id, ',"subStoreID":', IF(t4.sub_store_id IS NULL, 0, t4.sub_store_id),
',"price":', IF(t4.price IS NULL, 0, t4.price), ',"unitPrice":', IF(t4.unit_price IS NULL, 0, t4.unit_price),
',"price":', IF(t4.price IS NULL, 0, t4.price), ',"unitPrice":', IF(t4.unit_price IS NULL, t1.price, t4.unit_price),
',"storeSkuStatus":', IF(t4.status IS NULL, 0, t4.status), "}")), "]") skus_str
` + sql + `
ORDER BY t1.id