Commit 49b3c785 authored by hangjun83's avatar hangjun83

财务开票模块更新

parent 3dbe0c19
......@@ -3,14 +3,9 @@
namespace App\Rhawn\Repositories\Eloquent;
use App\Rhawn\Repositories\Contracts\BhuaProductRepository;
use App\Rhawn\Repositories\Contracts\RhawnProductRepository;
use App\Rhawn\Repositories\Models\BhuaProducts;
use Illuminate\Support\Facades\DB;
use Prettus\Validator\Contracts\ValidatorInterface;
/**
* Class UserRepositoryEloquent.
*/
class BhuaProductRepositoryEloquent extends BaseRepository implements BhuaProductRepository
{
/**
......@@ -163,10 +158,19 @@ class BhuaProductRepositoryEloquent extends BaseRepository implements BhuaProduc
return null;
}
/**
* @param $brandId
* @param $offset
* @param $limit
* @return null
*/
public function getProductsListByBrandId($brandId, $offset, $limit)
{
$productsModel = $this->join('chemicals', 'chemicals.c_id','products.c_id');
$product = $productsModel->where('products.b_id',$brandId)->offset($offset)->limit($limit)->get();
$product = $productsModel->where('products.b_id',$brandId)
->where('p_status',1)
->where('p_show',1)
->offset($offset)->limit($limit)->get();
if($product){
return $product->toArray();
}
......
......@@ -77,7 +77,7 @@ class BhuaProductsService
'p_status' => 1,
'p_show' => 1
];
$products = $this->bhuaProductService->productRepository->getProductsListByBrandId($where, $limit, $offset);
$products = $this->bhuaProductService->productRepository->getProductsListByBrandId($params['brand_id'], $limit, $offset);
$total = 0;
if($products){
$products = app(ProductsTransformer::class)->transform($products);
......
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