ActivityCalc.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. <?php
  2. use app\models\store\StoreOrderCartInfo;
  3. abstract class ActivityCalc {
  4. protected $ctx = [];
  5. public function __construct() {
  6. }
  7. /**
  8. * @param $cate_id
  9. * @return array
  10. */
  11. public static function getOrders($cate_id) {
  12. $products = StoreOrderCartInfo::alias('ci')
  13. ->join('store_order o', 'o.id=ci.oid')
  14. ->join('store_product p', 'ci.product_id=p.id')
  15. ->join('user u', 'u.uid = o.uid')
  16. ->where('o.paid', 1)
  17. ->where('o.status', '>=', 0)
  18. ->where('o.refund_status', 0)
  19. ->where('o.is_del', 0)
  20. ->where('o.is_system_del', 0)
  21. ->where('p.cart_id', $cate_id)
  22. ->where('ci.activity', '')
  23. ->field('o.id, o.pay_price, ci.product_id, ci.cart_info, u.uid, u.now_money, p.store_name')->select();
  24. $products = $products ? $products->toArray() : [];
  25. return $products;
  26. }
  27. abstract public function getId();
  28. abstract public function getName();
  29. }