1
This commit is contained in:
@@ -111,8 +111,10 @@ type StoresInfo struct {
|
||||
|
||||
type JxBadCommentsExt struct {
|
||||
legacymodel.JxBadComments
|
||||
StoreName string `json:"storeName"`
|
||||
CityName string `json:"cityName"`
|
||||
StoreName string `json:"storeName"`
|
||||
CityName string `json:"cityName"`
|
||||
OperatorPhone string `json:"operatorPhone"`
|
||||
UserName string `json:"userName"`
|
||||
|
||||
VendorOrderID2 string `orm:"column(vendor_order_id2);size(48);index" json:"vendorOrderID2"`
|
||||
}
|
||||
@@ -2031,7 +2033,7 @@ func TmpGetJxBadCommentsNo(ctx *jxcontext.Context, storeID int) (count int, err
|
||||
return count, err
|
||||
}
|
||||
|
||||
func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, keyword string, storeIDs []int, offset, pageSize, commentType int, fromTime, toTime time.Time) (retVal map[string]interface{}, err error) {
|
||||
func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, keyword string, storeIDs []int, offset, pageSize, commentType int, fromTime, toTime time.Time, orderFlag, operatorPhone string) (retVal map[string]interface{}, err error) {
|
||||
db := dao.GetDB()
|
||||
//权限
|
||||
if permission.IsRoled(ctx) {
|
||||
@@ -2058,11 +2060,19 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, keyword string, storeI
|
||||
sql := `
|
||||
SELECT SQL_CALC_FOUND_ROWS
|
||||
t1.*, t2.name store_name, t3.name city_name,
|
||||
t4.vendor_order_id2
|
||||
t4.vendor_order_id2,
|
||||
CASE t1.order_flag
|
||||
WHEN 0 THEN t2.operator_phone
|
||||
WHEN 1 THEN t2.operator_phone2
|
||||
WHEN 2 THEN t2.operator_phone3
|
||||
ELSE t2.market_man_phone
|
||||
END as operator_phone,
|
||||
t5.name as user_name,
|
||||
FROM jx_bad_comments t1
|
||||
LEFT JOIN store t2 ON t2.id = t1.jxstoreid
|
||||
LEFT JOIN place t3 ON t3.code = t2.city_code
|
||||
LEFT JOIN goods_order t4 ON t4.vendor_order_id = t1.order_id AND t4.vendor_id = t1.order_flag
|
||||
INNER JOIN user t5 ON t5.mobile = operator_phone
|
||||
WHERE 1 = 1
|
||||
`
|
||||
sqlParams := []interface{}{}
|
||||
@@ -2070,8 +2080,8 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, keyword string, storeI
|
||||
keywordLike := "%" + keyword + "%"
|
||||
sql += `
|
||||
AND (t1.order_id LIKE ? OR t1.jxstoreid LIKE ? OR t1.userphone LIKE ? OR t1.scorecontent LIKE ? OR t1.vendertags LIKE ? OR t1.updated_scorecontent LIKE ?
|
||||
OR t1.updated_vendertags LIKE ? OR t2.name LIKE ?)`
|
||||
sqlParams = append(sqlParams, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike)
|
||||
OR t1.updated_vendertags LIKE ? OR t2.name LIKE ? OR t1.vendor_order_id LIKE ?)`
|
||||
sqlParams = append(sqlParams, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike, keywordLike)
|
||||
}
|
||||
if len(storeIDs) > 0 {
|
||||
sql += " AND t1.jxstoreid IN (" + dao.GenQuestionMarks(len(storeIDs)) + ")"
|
||||
@@ -2094,6 +2104,16 @@ func TmpGetJxBadCommentsByStoreId(ctx *jxcontext.Context, keyword string, storeI
|
||||
sql += " AND t1.createtime < ?"
|
||||
sqlParams = append(sqlParams, toTime)
|
||||
}
|
||||
|
||||
if orderFlag != "" {
|
||||
sql += " AND t1.order_flag = ?"
|
||||
sqlParams = append(sqlParams, toTime)
|
||||
}
|
||||
if operatorPhone != "" {
|
||||
sql += " AND (t2.market_man_hone = ? OR t2.operator_phone = ? OR t2.operator_phone1 = ? OR t2.operator_phone2 = ?)"
|
||||
sqlParams = append(sqlParams, operatorPhone, operatorPhone, operatorPhone, operatorPhone)
|
||||
}
|
||||
|
||||
sql += " ORDER BY t1.createtime DESC"
|
||||
pageSize = jxutils.FormalizePageSize(pageSize)
|
||||
offset = jxutils.FormalizePageOffset(offset)
|
||||
|
||||
Reference in New Issue
Block a user