Commit 3554aab1 authored by hangjun83's avatar hangjun83

百化接口

parent 8d2e7bf4
......@@ -30,7 +30,7 @@ class BhuaProductRepositoryEloquent extends BaseRepository implements BhuaProduc
*/
public function getProductByPcode($pCode)
{
$productsModel = $this->join('chemicals', 'chemicals.c_id','products.c_id')->join('raw', 'raw.r_id','products.r_id');
$productsModel = $this;
if(!is_array($pCode)){
$productsModel->where('products.p_code',$pCode);
}else{
......@@ -45,7 +45,7 @@ class BhuaProductRepositoryEloquent extends BaseRepository implements BhuaProduc
public function getProductsByWhere(array $where)
{
$productsModel = $this->join('chemicals', 'chemicals.c_id','products.c_id');
$productsModel = $this;
foreach($where as $key => $w){
if(!is_array($w)){
$productsModel->where($key,$w);
......@@ -109,7 +109,7 @@ class BhuaProductRepositoryEloquent extends BaseRepository implements BhuaProduc
*/
public function getProductsList($where, $offset, $limit)
{
$productsModel = $this->join('chemicals', 'chemicals.c_id','products.c_id')->join('raw', 'raw.r_id','products.r_id');
$productsModel = $this;
if(!empty($where)){
foreach($where as $key => $w){
if(!is_array($w)){
......@@ -128,7 +128,7 @@ class BhuaProductRepositoryEloquent extends BaseRepository implements BhuaProduc
public function getProductsByCas($cas)
{
$productsModel = $this->join('chemicals', 'chemicals.c_id','products.c_id')->join('raw', 'raw.r_id','products.r_id');
$productsModel = $this;
$product = $productsModel->where('chemicals.c_cas',$cas)->get();
if($product){
return $product->toArray();
......
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