购物车列表.sql 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. SELECT t1.sa_shoppingcartid,
  2. t1.sa_brandid,
  3. t1.itemid,
  4. t3.itemname,
  5. t1.itemno,
  6. t1.sa_promotionid,
  7. t1.sa_promotion_itemsid,
  8. t1.tradefield tradefield_shoppingcart,
  9. t2.brandname,
  10. t1.qty,
  11. t1.length,
  12. t1.width,
  13. t1.cheek,
  14. t1.colors,
  15. t1.material,
  16. t3.model,
  17. t3.spec,
  18. t3.orderminqty,
  19. t3.orderaddqty,
  20. t3.orderminqty_auxunit,
  21. t3.orderaddqty_auxunit,
  22. t3.iscustomsize,
  23. t3.pricingmetod,
  24. t3.widthschemeid,
  25. t3.lengthschemeid,
  26. t4.unitname,
  27. t5.unitgroupname,
  28. t6.unitname auxunitname,
  29. t3.materialschemeid,
  30. t3.colorschemeid,
  31. t3.cheekschemeid,
  32. if(t1.sa_promotionid>0,ifnull(t7.packageqty,0),ifnull(t3.packageqty,0)) packageqty,
  33. t3.sa_customschemeid,
  34. t3.custamount
  35. FROM sa_shoppingcart t1
  36. LEFT JOIN sa_brand t2 ON t2.sa_brandid = t1.sa_brandid AND t2.siteid = t1.siteid
  37. LEFT JOIN plm_item t3 ON t3.itemid = t1.itemid AND t3.siteid = t1.siteid
  38. LEFT JOIN plm_unit t4 ON t4.unitid = t3.unitid AND t4.siteid = t1.siteid
  39. LEFT JOIN plm_unitgroup t5 ON t5.unitgroupid = t3.unitgroupid AND t5.siteid = t1.siteid
  40. LEFT JOIN plm_unit t6 ON t6.unitid = t5.auxunitid AND t5.siteid = t1.siteid
  41. LEFT JOIN sa_promotion_items t7 ON t7.sa_promotion_itemsid = t1.sa_promotion_itemsid AND t7.siteid = t1.siteid
  42. WHERE t1.sys_enterpriseid = $sys_enterpriseid$
  43. AND t1.siteid = $siteid$ and t3.istool = $istool$ and t1.sa_promotionid=$sa_promotionid$
  44. and $where$