|
@@ -967,7 +967,12 @@ func GetHisOrderInfoByNumberThree(order_number string) (order []*models.HisOrder
|
967
|
967
|
func GetOrderByTime(start_time int64, end_time int64, org_id int64, insutype string, clr_org string, clr_type string) (orders []*models.HisOrder, err error) {
|
968
|
968
|
|
969
|
969
|
if len(clr_org) > 0 {
|
970
|
|
- err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time) <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ? AND clr_optins = ?", org_id, end_time, start_time, insutype, clr_org).Find(&orders).Error
|
|
970
|
+ if len(clr_type) > 0 {
|
|
971
|
+ err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time) <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ? AND clr_type = ? AND clr_optins = ?", org_id, end_time, start_time, insutype, clr_type, clr_org).Find(&orders).Error
|
|
972
|
+ } else {
|
|
973
|
+ err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time) <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ? AND clr_optins = ?", org_id, end_time, start_time, insutype, clr_org).Find(&orders).Error
|
|
974
|
+ //err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time) <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ? ", org_id, end_time, start_time, insutype).Find(&orders).Error
|
|
975
|
+ }
|
971
|
976
|
} else {
|
972
|
977
|
if len(clr_type) > 0 {
|
973
|
978
|
err = readDb.Model(&models.HisOrder{}).Where("user_org_id = ? AND status = 1 AND order_status = 2 AND is_medicine_insurance = 1 AND UNIX_TIMESTAMP(setl_time) <= ? AND UNIX_TIMESTAMP(setl_time) >= ? AND insutype = ? AND clr_type = ?", org_id, end_time, start_time, insutype, clr_type).Find(&orders).Error
|