Order.php 469 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\home\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. ->paginate(10);
  16. return $result;
  17. }
  18. public function addOrder($data)
  19. {
  20. $result = $this->insert($data);
  21. return $result;
  22. }
  23. }