AuctionOrder.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. <?php
  2. /**
  3. *
  4. * @author: xaboy<365615158@qq.com>
  5. * @day: 2017/11/02
  6. */
  7. namespace app\models\auction;
  8. use app\admin\model\user\User;
  9. use app\admin\model\user\UserBill;
  10. use crmeb\services\product\Product;
  11. use crmeb\traits\ModelTrait;
  12. use crmeb\basic\BaseModel;
  13. /**
  14. * 预约 Model
  15. * Class WechatNews
  16. * @package app\admin\model\wechat
  17. */
  18. class AuctionOrder extends BaseModel
  19. {
  20. use ModelTrait;
  21. protected $pk = 'id';
  22. protected $name = 'auction_order';
  23. protected $autoWriteTimestamp = true;
  24. /**
  25. * 用户订单
  26. * @param $data
  27. * @param $uid
  28. * @return \think\Collection
  29. * @throws \think\db\exception\DataNotFoundException
  30. * @throws \think\db\exception\DbException
  31. * @throws \think\db\exception\ModelNotFoundException
  32. */
  33. public static function userOrder($data,$uid)
  34. {
  35. if ($data['type'] == 1){
  36. $list = self::where([['uid', '=', $uid], ['status', '=', 1]])->select()->toArray(); //待上传订单
  37. }else if($data['type'] == 2){
  38. $list = self::where([['uid', '=', $uid], ['status', '=', 2]])->select()->toArray(); //待审核订单
  39. }else if($data['type'] == 3) {
  40. $list = self::where([['uid', '=', $uid], ['status', '=', 3]])->select()->toArray(); //完成订单
  41. }else{
  42. $list = self::where([['uid', '=', $uid], ['status', '=', 3]])->select()->toArray(); //过期订单
  43. }
  44. return $list;
  45. }
  46. }