修复市级供应链
This commit is contained in:
parent
80b0e6efd6
commit
fd6b126cf4
@ -8,14 +8,11 @@ use app\common\repositories\store\product\SpuRepository;
|
|||||||
use think\facade\Db;
|
use think\facade\Db;
|
||||||
use think\App;
|
use think\App;
|
||||||
use crmeb\basic\BaseController;
|
use crmeb\basic\BaseController;
|
||||||
|
use app\common\dao\store\product\SpuDao;
|
||||||
|
|
||||||
class CloudWarehouse extends BaseController
|
class CloudWarehouse extends BaseController
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
|
||||||
* @var SpuRepository
|
|
||||||
*/
|
|
||||||
protected $repository;
|
|
||||||
/**
|
/**
|
||||||
* @var MerchantDao
|
* @var MerchantDao
|
||||||
*/
|
*/
|
||||||
@ -25,18 +22,20 @@ class CloudWarehouse extends BaseController
|
|||||||
*/
|
*/
|
||||||
protected $spuRepository;
|
protected $spuRepository;
|
||||||
|
|
||||||
|
protected $SpuDao;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* StoreProduct constructor.
|
* StoreProduct constructor.
|
||||||
* @param App $app
|
* @param App $app
|
||||||
* @param SpuRepository $repository
|
* @param SpuRepository $repository
|
||||||
* @param MerchantDao $merchantDao
|
* @param MerchantDao $merchantDao
|
||||||
*/
|
*/
|
||||||
public function __construct(App $app, SpuRepository $repository, MerchantDao $merchantDao, SpuRepository $spuRepository)
|
public function __construct(App $app, MerchantDao $merchantDao, SpuRepository $spuRepository,SpuDao $SpuDao)
|
||||||
{
|
{
|
||||||
parent::__construct($app);
|
parent::__construct($app);
|
||||||
$this->repository = $repository;
|
|
||||||
$this->merchantDao = $merchantDao;
|
$this->merchantDao = $merchantDao;
|
||||||
$this->spuRepository = $spuRepository;
|
$this->spuRepository = $spuRepository;
|
||||||
|
$this->SpuDao = $SpuDao;
|
||||||
$this->spuRepository->userInfo = $this->request->isLogin() ? $this->request->userInfo() : null;
|
$this->spuRepository->userInfo = $this->request->isLogin() ? $this->request->userInfo() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,24 +103,20 @@ class CloudWarehouse extends BaseController
|
|||||||
'status' => 1,
|
'status' => 1,
|
||||||
'is_del' => 0,
|
'is_del' => 0,
|
||||||
'mer_status' => 1,
|
'mer_status' => 1,
|
||||||
|
'product_type'=>98,
|
||||||
|
'product_id'=>$cloud_product
|
||||||
];
|
];
|
||||||
if (!$cloud_product && $category_id==0) {
|
if (!$cloud_product && $category_id==0) {
|
||||||
|
|
||||||
return app('json')->success(['count' => 0, 'list' => []]);
|
return app('json')->success(['count' => 0, 'list' => []]);
|
||||||
}
|
}
|
||||||
$count = Db::name('cloud_product')->where('street_code', $street_code)->where('status', 1)->count();
|
$count = Db::name('cloud_product')->where('street_code', $street_code)->where('status', 1)->count();
|
||||||
$select = Db::name('store_product')->whereIn('product_id', $cloud_product)->where($where)
|
|
||||||
->withAttr('merchant', function ($value, $data) {
|
$products = $this->spuRepository->getApiSearch($where,$page,10);
|
||||||
$find= Db::name('merchant')->where('mer_id', $data['mer_id'])->field('mer_id,mer_name')->find();
|
if($products['list']){
|
||||||
return $find;
|
$list=$products['list'];
|
||||||
})
|
}
|
||||||
->withAttr('sku', function ($value, $data) {
|
return app('json')->success(['count' => $count, 'list' => $list]);
|
||||||
$find = Db::name('store_product_attr_value')->where('mer_id', $data['mer_id'])->where('product_id', $data['product_id'])->find();
|
|
||||||
return ['' => $find];
|
|
||||||
})
|
|
||||||
// ->field('product_id,mer_id,store_name,bar_code,price,stock,product_type,image')
|
|
||||||
->select();
|
|
||||||
return app('json')->success(['count' => $count, 'list' => $select]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user