Commit 7a987e7b authored by hj's avatar hj

更新

parent f1b063a3
...@@ -137,10 +137,13 @@ class RhawnProductRepositoryEloquent extends BaseRepository implements RhawnProd ...@@ -137,10 +137,13 @@ class RhawnProductRepositoryEloquent extends BaseRepository implements RhawnProd
public function getProductIsHotByPid($pid) public function getProductIsHotByPid($pid)
{ {
$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)); $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)){ if(!empty($result)){
return $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