Order.php 511 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. namespace app\user\model;
  3. use think\Model;
  4. /**
  5. * 用户管理
  6. */
  7. class Order extends Model
  8. {
  9. public function getOrder($condition)
  10. {
  11. $result = $this
  12. ->alias('a')
  13. ->join('product b', 'a.product_id = b.product_id')
  14. ->where($condition)
  15. ->order('order_buyTime desc')
  16. ->paginate(10);
  17. return $result;
  18. }
  19. public function addOrder($data)
  20. {
  21. $result = $this->insert($data);
  22. return $result;
  23. }
  24. }