|
|
@@ -135,12 +135,12 @@ where a.`Status` > 0
|
|
|
//机具表
|
|
|
select a.Id as id, a.UserId as user_id,a.CreateDate as create_time, a.UpdateDate as update_time,
|
|
|
a.PosSn as pos_sn, a.StoreId as warehouse_id, a.BindMerchantId as merchant_id, a.BrandId as brand_id,
|
|
|
-a.IsPurchase as recycle_status, a.RecycEndDate as recycle_end_time,
|
|
|
+(case when a.IsPurchase = 0 && a.RecycEndDate > NOW() then 1 ELSE 0 end) as recycle_status, a.RecycEndDate as recycle_end_time,
|
|
|
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.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, RecycStatus,
|
|
|
-case when a.RecycEndDate < NOW() && a.BindingState = 0 then 1 ELSE 0 end return_status,
|
|
|
+a.RecycStatus as return_status,
|
|
|
b.StoreName as warehouse_name
|
|
|
FROM PosMachinesTwo a LEFT JOIN StoreHouse b on a.StoreId = b.id
|
|
|
//仓库表
|