|
|
@@ -76,15 +76,21 @@ class ProductBuying extends Model
|
|
|
}
|
|
|
|
|
|
//获取订单列表
|
|
|
- public static function getBuyingList(int $uid, string $lan, int $page)
|
|
|
+ public static function getBuyingList(int $productId)
|
|
|
{
|
|
|
- return self::alias('a')->where('user_id', $uid)
|
|
|
- ->join('product_list p', 'a.product_id = p.id')
|
|
|
- ->field('a.*,p.' . $lan . '_name as name,p.thum')
|
|
|
- ->order('id desc')
|
|
|
- ->paginate($page);
|
|
|
+ return self::where('product_id', $productId)->where('status', self::Normal)->field('id,min_price')->order('id desc')->select();
|
|
|
}
|
|
|
|
|
|
+ //获取订单列表
|
|
|
+ public static function getUserBuyingList(int $uid, string $lan, int $page)
|
|
|
+ {
|
|
|
+ return self::alias('a')->where('user_id', $uid)
|
|
|
+ ->join('product_list p', 'a.product_id = p.id')
|
|
|
+ ->field('a.*,p.' . $lan . '_name as name,p.thum')
|
|
|
+ ->order('id desc')
|
|
|
+ ->paginate($page);
|
|
|
+ }
|
|
|
+
|
|
|
public function getCreateTimeTextAttr($value, $data)
|
|
|
{
|
|
|
$value = $value ? $value : (isset($data['create_time']) ? $data['create_time'] : '');
|