* @day: 2017/11/02 */ namespace app\models\auction; use app\admin\model\user\User; use app\admin\model\user\UserBill; use crmeb\services\product\Product; use crmeb\traits\ModelTrait; use crmeb\basic\BaseModel; /** * 预约 Model * Class WechatNews * @package app\admin\model\wechat */ class AuctionOrder extends BaseModel { use ModelTrait; protected $pk = 'id'; protected $name = 'auction_order'; protected $autoWriteTimestamp = true; /** * 用户订单 * @param $data * @param $uid * @return \think\Collection * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public static function userOrder($data,$uid) { if ($data['type'] == 1){ $list = self::where([['uid', '=', $uid], ['status', '=', 1]])->select()->toArray(); //待上传订单 }else if($data['type'] == 2){ $list = self::where([['uid', '=', $uid], ['status', '=', 2]])->select()->toArray(); //待审核订单 }else if($data['type'] == 3) { $list = self::where([['uid', '=', $uid], ['status', '=', 3]])->select()->toArray(); //完成订单 }else{ $list = self::where([['uid', '=', $uid], ['status', '=', 3]])->select()->toArray(); //过期订单 } return $list; } }