1
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package dao
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.rosy.net.cn/baseapi/utils"
|
||||
"git.rosy.net.cn/jx-callback/business/jxutils"
|
||||
"git.rosy.net.cn/jx-callback/business/model"
|
||||
@@ -9,12 +10,12 @@ import (
|
||||
|
||||
func GetInvoiceInfo(db *DaoDB, vendorOrderId string) (*model.InvoiceMsg, error) {
|
||||
data := &model.InvoiceMsg{}
|
||||
sql := ` SELECT * FROM invoice_msg WHERE order_id = ? `
|
||||
err := GetRow(db, data, sql, []interface{}{vendorOrderId}...)
|
||||
sql := ` SELECT * FROM invoice_msg WHERE order_id = ? OR remark LIKE ?`
|
||||
err := GetRow(db, data, sql, []interface{}{vendorOrderId, "%" + fmt.Sprintf("%s", vendorOrderId) + "%"}...)
|
||||
return data, err
|
||||
}
|
||||
|
||||
func GetStoreInvoiceList(storeID int, startTime, endTime time.Time, status string, offset, pageSize int) (info *model.PagedInfo, err error) {
|
||||
func GetStoreInvoiceList(storeID, vendorId int, startTime, endTime time.Time, status string, offset, pageSize int) (info *model.PagedInfo, err error) {
|
||||
parameter := []interface{}{}
|
||||
sql := ` SELECT * FROM invoice_msg WHERE 1=1 `
|
||||
if storeID != 0 {
|
||||
@@ -29,6 +30,10 @@ func GetStoreInvoiceList(storeID int, startTime, endTime time.Time, status strin
|
||||
sql += ` AND created_at <= ? `
|
||||
parameter = append(parameter, endTime)
|
||||
}
|
||||
if vendorId != 0 {
|
||||
sql += ` AND vendor_id = ? `
|
||||
parameter = append(parameter, vendorId)
|
||||
}
|
||||
if status != "" {
|
||||
switch status {
|
||||
case "1": // 未回复
|
||||
@@ -53,3 +58,24 @@ func GetStoreInvoiceList(storeID int, startTime, endTime time.Time, status strin
|
||||
|
||||
return nil, err
|
||||
}
|
||||
|
||||
func GetInvoiceInfoByTaskId(db *DaoDB, taskId string) (*model.InvoiceMsg, error) {
|
||||
data := &model.InvoiceMsg{}
|
||||
sql := ` SELECT * FROM invoice_msg WHERE invoice_task_id = ?`
|
||||
err := GetRow(db, data, sql, []interface{}{taskId}...)
|
||||
return data, err
|
||||
}
|
||||
|
||||
func GetInvoiceByStoreId(db *DaoDB, storeId, vendorId int) ([]*model.InvoiceMsg, error) {
|
||||
param := []interface{}{}
|
||||
data := make([]*model.InvoiceMsg, 0, 0)
|
||||
sql := ` SELECT * FROM invoice_msg WHERE store_id = ? `
|
||||
param = append(param, storeId)
|
||||
if vendorId != 0 {
|
||||
sql += ` AND vendor_id = ?`
|
||||
param = append(param, vendorId)
|
||||
|
||||
}
|
||||
err := GetRows(db, data, sql, param...)
|
||||
return data, err
|
||||
}
|
||||
|
||||
@@ -131,6 +131,7 @@ type StoreSkuSyncInfo struct {
|
||||
QuaPictures string // 资质图片
|
||||
QuaEffectiveDate int64 // 资质有效期
|
||||
QuaApprovalDate int64 // 批准日期
|
||||
SpecialPictures string // 商品扩展规则(营业成分)
|
||||
|
||||
VendorVendorCatID int64 `orm:"column(vendor_vendor_cat_id)"` // 平台商品分类(叶子结点)
|
||||
CategoryName string `json:"categoryName"` //分类名
|
||||
@@ -591,7 +592,7 @@ func GetStoreSkus2(db *DaoDB, vendorID, storeID int, skuIDs []int, mustDirty boo
|
||||
%s vendor_sku_id, t1.%s_sync_status sku_sync_status, t1.%s_price vendor_price, t1.%s_lock_time lock_time,t1.vendor_son_sku_id,t1.vendor_sku_attr_id,t1.vendor_main_id,
|
||||
t1.store_id, t1.deleted_at bind_deleted_at,t1.status_sale_begin,t1.status_sale_end, t1.jds_ware_id, t1.stock, t1.mt_ladder_box_price,t1.location_code,
|
||||
t2.*,
|
||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.category_id name_category_id, t3.yb_name_suffix,t3.tiktok_attribute,t3.mt_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,
|
||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.category_id name_category_id, t3.yb_name_suffix,t3.tiktok_attribute,t3.mt_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,t3.special_pictures,
|
||||
t3.sell_point,t3.sell_point_times,t3.jds_stock_switch, t3.preparation_time, t3.img_watermark, t3.ex_vendor_id, t3.img img_origin,t3.upc_brand_name,t3.upc_tiktok_brand_id,
|
||||
IF(t11.%s <> '', t11.%s, t3.img) img,
|
||||
IF(t12.%s <> '', t12.%s, t3.img2) img2,
|
||||
@@ -722,7 +723,7 @@ func GetFullStoreSkus(db *DaoDB, vendorID, storeID int) (skus []*StoreSkuSyncInf
|
||||
t1.store_id, t1.deleted_at bind_deleted_at, t1.stock,t1.location_code,
|
||||
t2.*, t2.id sku_id, t2m.vendor_thing_id vendor_sku_id,
|
||||
t3.id name_id, t3.prefix, t3.name, t3.unit, t3.upc, t3.status name_status, t3.ex_prefix, t3.ex_prefix_begin, t3.ex_prefix_end, t3.category_id name_category_id,t3.tiktok_attribute,
|
||||
t3.mt_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,t3.sell_point,t3.sell_point_times,t3.upc_brand_name,t3.upc_tiktok_brand_id,
|
||||
t3.mt_attribute,t3.qua_pictures,t3.qua_effective_date,t3.qua_approval_date,t3.special_pictures,t3.sell_point,t3.sell_point_times,t3.upc_brand_name,t3.upc_tiktok_brand_id,
|
||||
IF(t11.%s <> '', t11.%s, t3.img) img,
|
||||
IF(t12.%s <> '', t12.%s, t3.img2) img2,
|
||||
IF(t13.%s <> '', t13.%s, t3.desc_img) desc_img,
|
||||
|
||||
Reference in New Issue
Block a user