Commit f1b063a3 authored by hj's avatar hj

更新

parent e6d907e3
......@@ -137,12 +137,10 @@ class RhawnProductRepositoryEloquent extends BaseRepository implements RhawnProd
public function getProductIsHotByPid($pid)
{
$promotions = DB::connection($this->getConnectionName())
->raw("SELECT sum(`pstk_num` - `pstk_lock_num`) as `real_num` FROM `pstock` where `si_ids` = '' AND `p_id` = ".$pid)->getValue();
if($promotions){
$promotions = $promotions->toArray();
return $promotions;
$result =DB::connection($this->getConnectionName())->select(DB::raw("SELECT sum(`pstk_num` - `pstk_lock_num`) as `real_num` FROM `pstock` where `si_ids` = '' AND `p_id` = ".$pid));
if(!empty($result)){
return $result;
}
return null;
return null
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment