- GetServerInfo added.
This commit is contained in:
@@ -35,13 +35,6 @@ func GetVendorCategories(vendorID int, parentID int) (vendorCats []*model.SkuVen
|
||||
return vendorCats, dao.GetEntities(nil, &vendorCats, cond, false)
|
||||
}
|
||||
|
||||
func GetSkuMetaInfo() (*model.SkuMetaInfo, error) {
|
||||
return &model.SkuMetaInfo{
|
||||
Units: model.UnitNames,
|
||||
SpecUnits: model.SpecUnitNames,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// parentID 为-1表示所有
|
||||
func GetCategories(parentID int) (cats []*model.SkuCategory, err error) {
|
||||
if parentID == -1 {
|
||||
@@ -196,7 +189,7 @@ func GetSkuNames(keyword string, params map[string]interface{}, offset, pageSize
|
||||
if params["toStatus"] != nil {
|
||||
toStatus = params["toStatus"].(int)
|
||||
}
|
||||
sql += " AND t1.status >= ? AND t1.status <= ?"
|
||||
sql += " AND t2.status >= ? AND t2.status <= ?"
|
||||
sqlParams = append(sqlParams, fromStatus, toStatus)
|
||||
}
|
||||
sql += `
|
||||
@@ -210,7 +203,6 @@ func GetSkuNames(keyword string, params map[string]interface{}, offset, pageSize
|
||||
t1.comment,
|
||||
t1.brand_id,
|
||||
t1.category_id,
|
||||
t1.status,
|
||||
t1.is_global,
|
||||
t1.unit,
|
||||
t1.price,
|
||||
@@ -229,13 +221,12 @@ func GetSkuNames(keyword string, params map[string]interface{}, offset, pageSize
|
||||
t1.comment,
|
||||
t1.brand_id,
|
||||
t1.category_id,
|
||||
t1.status,
|
||||
t1.is_global,
|
||||
t1.unit,
|
||||
t1.price,
|
||||
t1.img,
|
||||
t1.elm_img_hash_code,
|
||||
CONCAT("[", GROUP_CONCAT(CONCAT('{"id":', t2.id, ',"createdAt":"', CONCAT(REPLACE(t2.created_at," ","T"),"+08:00"), '","updatedAt":"', CONCAT(REPLACE(t2.updated_at," ","T"),"+08:00"), '","lastOperator":"', t2.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, "}")), "]") skus_str
|
||||
CONCAT("[", GROUP_CONCAT(CONCAT('{"id":', t2.id, ',"status":', t2.status, ',"createdAt":"', CONCAT(REPLACE(t2.created_at," ","T"),"+08:00"), '","updatedAt":"', CONCAT(REPLACE(t2.updated_at," ","T"),"+08:00"), '","lastOperator":"', t2.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, "}")), "]") skus_str
|
||||
` + sql + `
|
||||
ORDER BY t1.id
|
||||
LIMIT ? OFFSET ?`
|
||||
|
||||
Reference in New Issue
Block a user