更新状态查询
This commit is contained in:
parent
e598ca1e21
commit
e95dd996f6
@ -79,6 +79,7 @@ class StoreSpu extends BaseController
|
||||
public function streetLst($id)
|
||||
{
|
||||
[$page, $limit] = $this->getPage();
|
||||
$typeStoreId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeStore'])->value('mer_type_id');
|
||||
$where = $this->request->params([
|
||||
'keyword',
|
||||
'cate_id',
|
||||
@ -99,7 +100,7 @@ class StoreSpu extends BaseController
|
||||
$where['is_gift_bag'] = 0;
|
||||
$where['product_type'] = 0;
|
||||
$where['order'] = $where['order'] ?: 'star';
|
||||
$where['mer_ids'] = Merchant::getInstance()->where('type_id', Merchant::TypeStore)->where('street_id', $id)
|
||||
$where['mer_ids'] = Merchant::getInstance()->where('type_id', $typeStoreId)->where('street_id', $id)
|
||||
->where(['status' => 1, 'mer_state' => 1, 'is_del' => 0])->column('mer_id');
|
||||
if ($where['is_trader'] != 1) unset($where['is_trader']);
|
||||
$data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo);
|
||||
@ -169,6 +170,7 @@ class StoreSpu extends BaseController
|
||||
{
|
||||
[$page, $limit] = $this->getPage();
|
||||
$where = $this->request->params(['common','mer_id']);
|
||||
$typeStoreId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeStore'])->value('mer_type_id');
|
||||
$where['is_gift_bag'] = 0;
|
||||
//1:星级
|
||||
//2:用户收藏
|
||||
@ -194,7 +196,7 @@ class StoreSpu extends BaseController
|
||||
}
|
||||
$where['product_type'] = 0;
|
||||
$where['is_stock'] = 1;
|
||||
$where['mer_ids'] = Merchant::getInstance()->where('type_id', Merchant::TypeStore)
|
||||
$where['mer_ids'] = Merchant::getInstance()->where('type_id', $typeStoreId)
|
||||
->where(['status' => 1, 'mer_state' => 1, 'is_del' => 0])->column('mer_id');
|
||||
$data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo);
|
||||
return app('json')->success($data);
|
||||
|
@ -9,6 +9,7 @@ use app\common\model\store\product\Product;
|
||||
use app\common\model\system\merchant\Merchant;
|
||||
use crmeb\services\RedisCacheService;
|
||||
use app\common\model\store\product\CloudProduct as CloudProductModel;
|
||||
use think\facade\Db;
|
||||
|
||||
class CloudProduct
|
||||
{
|
||||
@ -16,6 +17,7 @@ class CloudProduct
|
||||
public function handle($event)
|
||||
{
|
||||
$productIds = $event['product_id'];
|
||||
$typeStoreId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeStore'])->value('mer_type_id');
|
||||
$products = Product::withTrashed()->whereIn('product_id', $productIds)->field('product_id,mer_id,status,is_del,is_show,mer_status,is_used')->select();
|
||||
/** @var CloudProductDao $repo */
|
||||
$repo = app()->make(CloudProductDao::class);
|
||||
@ -23,7 +25,7 @@ class CloudProduct
|
||||
$RedisCacheService = app()->make(RedisCacheService::class);
|
||||
$clearCache = [];
|
||||
foreach ($products as $product) {
|
||||
$categoryId = Merchant::getDB()->where('mer_id', $product['mer_id'])->where('type_id', Merchant::TypeStore)->value('category_id');
|
||||
$categoryId = Merchant::getDB()->where('mer_id', $product['mer_id'])->where('type_id', $typeStoreId)->value('category_id');
|
||||
if (!$categoryId) {
|
||||
continue;
|
||||
}
|
||||
|
@ -71,8 +71,9 @@ class paySuccessOrder
|
||||
|
||||
//入口商户佣金
|
||||
$entryMerId = $item['source_id'];
|
||||
$typeStoreId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeStore'])->value('mer_type_id');
|
||||
$entryMerchant = app()->make(MerchantDao::class)->get($entryMerId);
|
||||
if ($entryMerchant['type_id'] == Merchant::TypeStore) {
|
||||
if ($entryMerchant['type_id'] == $typeStoreId) {
|
||||
$merchantRate = systemConfig('commission_to_merchant_rate');
|
||||
$merchantAmount = bcmul($this->totalAmount, (string)($merchantRate / 100), 2);
|
||||
if ($merchantAmount > 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user