|
@@ -140,8 +140,9 @@ a.PosSn as pos_sn, a.StoreId as warehouse_id, a.BindMerchantId as merchant_id, a
|
|
|
a.PosSnType as machine_type, ifnull(a.PrizeParams, 299) as cash_pledge, case when a.SeoKeyword > 1000 then a.SeoKeyword / 100 ELSE a.SeoKeyword end as source_pledge,
|
|
a.PosSnType as machine_type, ifnull(a.PrizeParams, 299) as cash_pledge, case when a.SeoKeyword > 1000 then a.SeoKeyword / 100 ELSE a.SeoKeyword end as source_pledge,
|
|
|
a.BindingTime as bind_time, a.ActivationTime as act_time, a.DownFee as machine_ratio, a.ActivationState as is_act, a.BindingState as bind_status,
|
|
a.BindingTime as bind_time, a.ActivationTime as act_time, a.DownFee as machine_ratio, a.ActivationState as is_act, a.BindingState as bind_status,
|
|
|
a.IsFirst as is_first, a.LeaderUserId as leader_id, a.OpId as partner_id, TransferTime as delivery_time, UpFeeFlag as up_fee_flag, DownFeeFlag as down_fee_flag,
|
|
a.IsFirst as is_first, a.LeaderUserId as leader_id, a.OpId as partner_id, TransferTime as delivery_time, UpFeeFlag as up_fee_flag, DownFeeFlag as down_fee_flag,
|
|
|
-IsSupplement as is_supply, IsOpAct as is_op_act, case when a.UserId = 0 then 0 ELSE 1 end status,
|
|
|
|
|
-a.RecycStatus as return_status,
|
|
|
|
|
|
|
+IsSupplement as is_supply, IsOpAct as is_op_act, case when a.UserId = 0 then 0 when a.Status = -1 then -1 ELSE 1 end status,
|
|
|
|
|
+(case when a.IsPurchase = 0 && a.RecycEndDate < NOW() && a.BindingState = 0 then 1 ELSE 0 end) as return_status,
|
|
|
|
|
+a.CreditTrade as credit_trade, a.DebitCardTrade as debit_card_trade, a.ScanQrTrade as scan_qr_trade,
|
|
|
b.StoreName as warehouse_name
|
|
b.StoreName as warehouse_name
|
|
|
FROM PosMachinesTwo a LEFT JOIN StoreHouse b on a.StoreId = b.id
|
|
FROM PosMachinesTwo a LEFT JOIN StoreHouse b on a.StoreId = b.id
|
|
|
|
|
|
|
@@ -195,7 +196,7 @@ FROM MerchantDepositSet a
|
|
|
//费率调整记录
|
|
//费率调整记录
|
|
|
SELECT a.Id as id, a.UserId as user_id, a.CreateDate as create_time, a.UpdateDate as update_time,
|
|
SELECT a.Id as id, a.UserId as user_id, a.CreateDate as create_time, a.UpdateDate as update_time,
|
|
|
case a.status when -1 then 0 when 1 then 1 end as status, a.SeoDescription as remark, a.MerchantId as merchant_id,
|
|
case a.status when -1 then 0 when 1 then 1 end as status, a.SeoDescription as remark, a.MerchantId as merchant_id,
|
|
|
- a.ChangeFee as ratio, a.sort as brand_id, a.PosId as machine_id,
|
|
|
|
|
|
|
+ a.ChangeFee as ratio, a.sort as brand_id, a.PosId as machine_id, a.PosUserId as pos_user_id,
|
|
|
a.PosSn as pos_sn
|
|
a.PosSn as pos_sn
|
|
|
FROM PosMachinesFeeChangeRecord a
|
|
FROM PosMachinesFeeChangeRecord a
|
|
|
//机具券
|
|
//机具券
|
|
@@ -215,4 +216,10 @@ left join Users uu on uu.id = a.ToUserId
|
|
|
//机具券划拨订单明细
|
|
//机具券划拨订单明细
|
|
|
SELECT a.Id as id, a.CreateDate as create_time, a.UpdateDate as update_time,
|
|
SELECT a.Id as id, a.CreateDate as create_time, a.UpdateDate as update_time,
|
|
|
a.PosCouponId as ticket_id,a.OrderNo as order_sn, b.ExchangeCode as ticket_code
|
|
a.PosCouponId as ticket_id,a.OrderNo as order_sn, b.ExchangeCode as ticket_code
|
|
|
-FROM PosCouponRecord a left join PosCoupons b on a.PosCouponId = b.id
|
|
|
|
|
|
|
+FROM PosCouponRecord a left join PosCoupons b on a.PosCouponId = b.id
|
|
|
|
|
+//商户表
|
|
|
|
|
+SELECT a.Id as id, a.UserId as user_id, a.CreateDate as create_time, a.UpdateDate as update_time,
|
|
|
|
|
+a.MerchantNo as merchant_no, a.MerchantName as merchant_name, a.MerIdcardNo as merchant_card, a.MerchantMobile as merchant_phone,
|
|
|
|
|
+a.BrandId as brand_id, a.MerUserId as maker_user_id, a.MerUserType as is_maker, b.id as machine_id, a.StandardStatus as standard_status, a.StandardMonths as standard_months,
|
|
|
|
|
+a.Remark as remark
|
|
|
|
|
+FROM PosMerchantInfo a LEFT JOIN PosMachinesTwo b on a.KqSnNo = b.PosSn
|