|
@@ -58,20 +58,11 @@ class StoreProduct extends BaseModel
|
|
|
return htmlspecialchars_decode($value);
|
|
|
}
|
|
|
|
|
|
- public static function getIntegralProduct($field = '*', $limit = 0)
|
|
|
+ public static function getValidProduct($productId, $field = 'min_integral,max_integral,add_time,browse,cate_id,code_path,cost,ficti,give_integral,id,image,is_sub,is_bargain,is_benefit,is_best,is_del,is_hot,is_new,is_postage,is_seckill,is_show,keyword,mer_id,mer_use,ot_price,postage,price,sales,slider_image,sort,stock,store_info,store_name,unit_name,vip_price,spec_type,IFNULL(sales,0) + IFNULL(ficti,0) as fsales,video_link')
|
|
|
{
|
|
|
- $model = self::where('max_integral', '>', 0)
|
|
|
- ->where('is_del', 0)->where('mer_id', 0)->where('stock', '>', 0)
|
|
|
- ->where('is_show', 1)->field($field)
|
|
|
- ->order('sort DESC, id DESC');
|
|
|
- if ($limit) $model->limit($limit);
|
|
|
- $data = $model->select();
|
|
|
- if (count($data) > 0) {
|
|
|
- foreach ($data as $k => $v) {
|
|
|
- $data[$k]['activity'] = self::activity($v['id']);
|
|
|
- }
|
|
|
- }
|
|
|
- return $data;
|
|
|
+ $Product = self::where('is_del', 0)->where('is_show', 1)->where('id', $productId)->field($field)->find();
|
|
|
+ if ($Product) return $Product->toArray();
|
|
|
+ else return false;
|
|
|
}
|
|
|
|
|
|
public static function getGoodList($limit = 18, $field = '*')
|
|
@@ -630,4 +621,19 @@ class StoreProduct extends BaseModel
|
|
|
|
|
|
|
|
|
|
|
|
+ public static function getIntegralProduct($field = '*', $limit = 0)
|
|
|
+ {
|
|
|
+ $model = self::where('max_integral', '>', 0)
|
|
|
+ ->where('is_del', 0)->where('mer_id', 0)->where('stock', '>', 0)
|
|
|
+ ->where('is_show', 1)->field($field)
|
|
|
+ ->order('sort DESC, id DESC');
|
|
|
+ if ($limit) $model->limit($limit);
|
|
|
+ $data = $model->select();
|
|
|
+ if (count($data) > 0) {
|
|
|
+ foreach ($data as $k => $v) {
|
|
|
+ $data[$k]['activity'] = self::activity($v['id']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $data;
|
|
|
+ }
|
|
|
}
|