@ -79,6 +79,10 @@ class MerchantDao extends BaseDao
|
||||
->when(isset($where['type_id']) && $where['type_id'] !== '', function ($query) use ($where) {
|
||||
$query->whereIn('type_id', is_array($where['type_id']) ? $where['type_id'] : explode(',', $where['type_id']));
|
||||
})
|
||||
->when(isset($where['type_code']) && $where['type_code'] !== '', function ($query) use ($where) {
|
||||
$typeId = Db::name('MerchantType')->where('type_code', $where['type_code'])->value('mer_type_id');
|
||||
$query->where('type_id', $typeId);
|
||||
})
|
||||
->when(isset($where['delivery_way']) && $where['delivery_way'] !== '', function ($query) use ($where) {
|
||||
$query->whereLike('delivery_way', "%{$where['delivery_way']}%");
|
||||
});
|
||||
|
@ -31,12 +31,27 @@ class Merchant extends BaseModel
|
||||
const TypeStore = 10; //镇街店铺
|
||||
const TypeCloudWarehouse = 11; //镇级云仓
|
||||
const TypeSupplyChain = 12; //市级供应链
|
||||
const TypePlatform = 13; //市级云仓
|
||||
const TypePlatform = 13; //市级里海云
|
||||
const TypeTeamServer = 14; //小组服务团
|
||||
const TypeVillageServer = 15; //村服务团队
|
||||
const TypeTownServer = 16; //镇服务团队
|
||||
const TypeTownSupplyChain = 17; //镇级供应链
|
||||
|
||||
//定义店铺类型code
|
||||
const TypeCode = [
|
||||
'TypeStore' => 'TypeStore', //镇街店铺
|
||||
'TypeCloudWarehouse' => 'TypeCloudWarehouse', //镇级云仓
|
||||
'TypeSupplyChain' => 'TypeSupplyChain', //市级供应链
|
||||
'TypePlatform' => 'TypePlatform', //市级里海云
|
||||
'TypeTeamServer' => 'TypeTeamServer', //小组服务团
|
||||
'TypeVillageServer' => 'TypeVillageServer', //村服务团队
|
||||
'TypeTownServer' => 'TypeTownServer', //镇服务团队
|
||||
'TypeTownSupplyChain' => 'TypeTownSupplyChain', //镇级供应链
|
||||
'TypeFamousSpecialties' => 'TypeFamousSpecialties', //名优特产
|
||||
'TypeLocalCuisine' => 'TypeLocalCuisine', //当地美食
|
||||
'TypeFeaturedCultural' => 'TypeFeaturedCultural', //特色文旅
|
||||
];
|
||||
|
||||
const TypeMap = [
|
||||
self::TypeStore => '镇街店铺',
|
||||
self::TypeCloudWarehouse => '里海云仓',
|
||||
|
@ -51,16 +51,26 @@ class MerchantTypeRepository extends BaseRepository
|
||||
|
||||
public function getSelect($getAll = true, $siftStore = false)
|
||||
{
|
||||
$merTypeIds = $this->userApply ? Merchant::AllowApply : Merchant::AllowDisplay;
|
||||
// $merTypeIds = $this->userApply ? Merchant::AllowApply : Merchant::AllowDisplay;
|
||||
$merTypeIds = [];
|
||||
$queryBuilder = MerchantType::getDB();
|
||||
if ($this->userApply) {
|
||||
$queryBuilder = $queryBuilder->where('is_allow_apply', 1);
|
||||
} else {
|
||||
$queryBuilder = $queryBuilder->where('is_search_display', 1);
|
||||
}
|
||||
|
||||
// 搜索商家时屏蔽市级供应链
|
||||
// Merchant::TypeSupplyChain
|
||||
if ($siftStore == true) {
|
||||
foreach($merTypeIds as $k=>$v) {
|
||||
if ($v == Merchant::TypeSupplyChain) {
|
||||
unset($merTypeIds[$k]);
|
||||
}
|
||||
}
|
||||
// foreach($merTypeIds as $k=>$v) {
|
||||
// if ($v == Merchant::TypeSupplyChain) {
|
||||
// unset($merTypeIds[$k]);
|
||||
// }
|
||||
// }
|
||||
$queryBuilder = $queryBuilder->where('type_code', '<>', Merchant::TypeCode['TypeSupplyChain']);
|
||||
}
|
||||
$merTypeIds = $queryBuilder->fetchSql(false)->column('mer_type_id');
|
||||
$query = MerchantType::getDB()->when(!$getAll, function ($query) use ($merTypeIds) {
|
||||
$query->whereIn('mer_type_id', $merTypeIds);
|
||||
})->field('mer_type_id,type_name');
|
||||
|
@ -91,7 +91,7 @@ class MerchantType extends BaseController
|
||||
|
||||
protected function getValidParams()
|
||||
{
|
||||
$data = $this->request->params(['type_name', 'type_info', 'is_margin', 'margin', 'auth', 'description']);
|
||||
$data = $this->request->params(['type_name', 'type_info', 'is_margin', 'margin', 'auth', 'description', 'is_allow_apply', 'is_search_display', 'is_sync_prod', 'type_code']);
|
||||
$validate = app()->make(MerchantTypeValidate::class);
|
||||
$validate->check($data);
|
||||
if ($data['is_margin'] == 1) {
|
||||
|
@ -211,6 +211,7 @@ class Auth extends BaseController
|
||||
if ($mer_arr && $mer_arr['mer_avatar'] != '' && $mer_arr['mer_banner'] != '' && $mer_arr['mer_info'] && $mer_arr['service_phone'] != '' && $mer_arr['mer_address'] != '') {
|
||||
$data['is_wsxx'] = 1;
|
||||
}
|
||||
$mer_arr['type_code'] = Db::name('merchant_type')->where('mer_type_id', $mer_arr['type_id'])->value('type_code');
|
||||
$data['mer_info'] = $mer_arr;
|
||||
}
|
||||
$data['fan_num'] = app()->make(RelevanceRepository::class)->getUserFans($user->uid, 1, 1, 1);
|
||||
@ -908,11 +909,12 @@ class Auth extends BaseController
|
||||
public function merchantCate()
|
||||
{
|
||||
$cateList = Db::name('MerchantCategory')->field(['merchant_category_id', 'category_name'])->select();
|
||||
$typeList = [
|
||||
['merchant_category_id' => Merchant::TypeStore ?? 0, 'category_name' => Merchant::TypeMap[Merchant::TypeStore] ?? ''],
|
||||
['merchant_category_id' => Merchant::TypeTownSupplyChain ?? 0, 'category_name' => Merchant::TypeMap[Merchant::TypeTownSupplyChain] ?? ''],
|
||||
['merchant_category_id' => Merchant::TypeSupplyChain ?? 0, 'category_name' => Merchant::TypeMap[Merchant::TypeSupplyChain] ?? '']
|
||||
];
|
||||
// $typeList = [
|
||||
// ['merchant_category_id' => Merchant::TypeStore ?? 0, 'category_name' => Merchant::TypeMap[Merchant::TypeStore] ?? ''],
|
||||
// ['merchant_category_id' => Merchant::TypeTownSupplyChain ?? 0, 'category_name' => Merchant::TypeMap[Merchant::TypeTownSupplyChain] ?? ''],
|
||||
// ['merchant_category_id' => Merchant::TypeSupplyChain ?? 0, 'category_name' => Merchant::TypeMap[Merchant::TypeSupplyChain] ?? '']
|
||||
// ];
|
||||
$typeList = Db::name('MerchantType')->where('is_allow_apply', 1)->field(['mer_type_id as merchant_category_id', 'type_name as category_name'])->select();
|
||||
$data = [
|
||||
'category' => $cateList,
|
||||
'type' => $typeList
|
||||
@ -1288,4 +1290,13 @@ class Auth extends BaseController
|
||||
}
|
||||
return app('json')->success([]);
|
||||
}
|
||||
//根据street_id获取商户信息
|
||||
public function regionMerchant($street_id)
|
||||
{
|
||||
[$page, $limit] = $this->getPage();
|
||||
$queryBuilder = Db::name('Merchant')->where('status', 1)->where('is_del', 0)->where('street_id', $street_id);
|
||||
$count = $queryBuilder->count();
|
||||
$list = $queryBuilder->setOption('field', [])->field(['mer_id', 'category_id', 'type_id', 'mer_name', 'area_id', 'street_id', 'village_id', 'mer_address', 'long', 'lat', 'create_time'])->order('mer_id', 'desc')->page($page, $limit)->fetchSql(false)->select();
|
||||
return app('json')->success(compact('count', 'list'));
|
||||
}
|
||||
}
|
||||
|
@ -620,7 +620,8 @@ class Community extends BaseController
|
||||
public function entrust()
|
||||
{
|
||||
$data = $this->checkParams();
|
||||
$merchantInfo = Db::name('merchant')->where('mer_id', $data['entrust_mer_id'] ?? 0)->where('type_id', Merchant::TypeSupplyChain)->fetchSql(false)->find();
|
||||
$typeSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeSupplyChain'])->value('mer_type_id');
|
||||
$merchantInfo = Db::name('merchant')->where('mer_id', $data['entrust_mer_id'] ?? 0)->where('type_id', $typeSupplyChainId)->fetchSql(false)->find();
|
||||
if (!$merchantInfo) {
|
||||
return app('json')->fail('此商户不支持委托');
|
||||
}
|
||||
|
@ -120,7 +120,8 @@ class StoreProduct extends BaseController
|
||||
}
|
||||
$data['mer_status'] = ($merchant['is_del'] || !$merchant['mer_state'] || !$merchant['status']) ? 0 : 1;
|
||||
$data['mer_id'] = $merId;
|
||||
$productType = $merchant->type_id == Merchant::TypeSupplyChain ? 98 : 0;
|
||||
$typeSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeSupplyChain'])->value('mer_type_id');
|
||||
$productType = $merchant->type_id == $typeSupplyChainId ? 98 : 0;
|
||||
$this->repository->edit($id, $data, $merId, $productType, 1);
|
||||
return app('json')->success('编辑成功');
|
||||
}
|
||||
|
@ -55,10 +55,10 @@ class Merchant extends BaseController
|
||||
public function lst()
|
||||
{
|
||||
[$page, $limit] = $this->getPage();
|
||||
$where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id', 'type_id','is_trader', 'street_id', 'credit_buy']);
|
||||
$where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id', 'type_id', 'type_code', 'is_trader', 'street_id', 'credit_buy']);
|
||||
if (empty($where['type_id'])) {
|
||||
//$where['type_id'] = [MerchantModel::TypeCloudWarehouse, MerchantModel::TypeStore, MerchantModel::TypeSupplyChain, MerchantModel::TypePlatform];
|
||||
$where['type_id'] = [MerchantModel::TypeTownSupplyChain, MerchantModel::TypeStore];
|
||||
$where['type_id'] = Db::name('MerchantType')->where('is_allow_apply', 1)->where('type_code', '<>', MerchantModel::TypeCode['TypeSupplyChain'])->column('mer_type_id');
|
||||
}
|
||||
return app('json')->success($this->repository->getList($where, $page, $limit, $this->userInfo));
|
||||
}
|
||||
|
@ -101,11 +101,11 @@ class StoreOrder extends BaseController
|
||||
return app('json')->fail('数据无效');
|
||||
|
||||
if ($addressId) {
|
||||
$deliveryWay = !empty($takes[0]) ? $takes[0] : 0;
|
||||
$addressRepository = app()->make(UserAddressRepository::class);
|
||||
$address = $addressRepository->getWhere(['uid' => $uid, 'address_id' => $addressId]);
|
||||
$cartProductType = Db::name('StoreCart')->where('cart_id', $cartId[0] ?? 0)->value('product_type');
|
||||
if ($cartProductType == 0 && $deliveryWay != 1) {
|
||||
$deliveryWay = !empty($takes) ? $takes : [];
|
||||
if ($cartProductType == 0 && count($deliveryWay) == 0) {
|
||||
$userAddressCode = ($address['province_code'] ?? '') . ',' . ($address['city_code'] ?? '') . ',' . ($address['district_code'] ?? '') . ',' . ($address['street_code'] ?? '') . ',' . ($address['village_code'] ?? '') . ',' . ($address['brigade_id'] ?? 0);
|
||||
$getUrl = env('LOGISTICS_HOST_URL') . '/api/hasCourier?user_address_code=' . $userAddressCode;
|
||||
$ch = curl_init();
|
||||
|
@ -5,6 +5,7 @@ namespace app\controller\api\store\product;
|
||||
use app\common\dao\system\merchant\MerchantDao;
|
||||
use app\common\model\system\merchant\Merchant;
|
||||
use app\common\repositories\store\product\SpuRepository;
|
||||
use think\facade\Db;
|
||||
use think\App;
|
||||
use crmeb\basic\BaseController;
|
||||
|
||||
@ -45,10 +46,11 @@ class CloudWarehouse extends BaseController
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$typeStoreId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeStore'])->value('mer_type_id');
|
||||
$params = $this->request->params(['category_id', 'street_code', 'order', ['product_type', 0], 'keyword']);
|
||||
$search = [
|
||||
'street_id' => $params['street_code'],
|
||||
'type_id' => Merchant::TypeStore,
|
||||
'type_id' => $typeStoreId,
|
||||
'category_id' => $params['category_id'],
|
||||
'status' => 1,
|
||||
'is_del' => 0,
|
||||
@ -59,9 +61,10 @@ class CloudWarehouse extends BaseController
|
||||
if (empty($merchantIds)) {
|
||||
return app('json')->success(['count' => 0, 'list' => []]);
|
||||
}
|
||||
$typeCloudWarehouseId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeCloudWarehouse'])->value('mer_type_id');
|
||||
$entryWhere = [
|
||||
'street_id' => $params['street_code'],
|
||||
'type_id' => Merchant::TypeCloudWarehouse,
|
||||
'type_id' => $typeCloudWarehouseId,
|
||||
'category_id' => $params['category_id'],
|
||||
'status' => 1,
|
||||
'is_del' => 0,
|
||||
|
@ -10,7 +10,8 @@ class StoreMicro extends BaseController
|
||||
{
|
||||
function seach_bar_code($mer_id,$code='',$name=''){
|
||||
$category_id=Db::name('merchant')->where('mer_id',$mer_id)->value('category_id');
|
||||
$platformMerId = app()->make(MerchantDao::class)->getValidMerchant(['category_id' => $category_id, 'type_id' => Merchant::TypePlatform], 'mer_id')->value('mer_id');
|
||||
$typePlatformId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypePlatform'])->value('mer_type_id');
|
||||
$platformMerId = app()->make(MerchantDao::class)->getValidMerchant(['category_id' => $category_id, 'type_id' => $typePlatformId], 'mer_id')->value('mer_id');
|
||||
$productWhere = ['is_show' => 1, 'status' => 1, 'mer_status' => 1, 'is_del' => 0];
|
||||
if($code!=''){
|
||||
if (strlen($code) != 13) {
|
||||
|
@ -42,6 +42,7 @@ class StoreSpu extends BaseController
|
||||
public function lst()
|
||||
{
|
||||
[$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',
|
||||
@ -62,7 +63,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['mer_ids'] = Merchant::getInstance()->where('type_id', $typeStoreId)
|
||||
->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);
|
||||
@ -78,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',
|
||||
@ -98,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);
|
||||
@ -141,12 +143,13 @@ class StoreSpu extends BaseController
|
||||
]);
|
||||
if ($where['action']) unset($where['product_type']);
|
||||
$currentMerchant = Db::name('merchant')->where('mer_id',$id)->field('category_id,street_id')->find();
|
||||
$typeCloudWarehouseId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeCloudWarehouse'])->value('mer_type_id');
|
||||
$mer_id = Db::name('merchant')
|
||||
->where('street_id',$currentMerchant['street_id'])
|
||||
->where('mer_state',1)
|
||||
->where('status',1)
|
||||
->where('category_id',$currentMerchant['category_id'])
|
||||
->where('type_id',Merchant::TypeCloudWarehouse)
|
||||
->where('type_id', $typeCloudWarehouseId)
|
||||
->value('mer_id');
|
||||
if (!$mer_id) {
|
||||
return app('json')->success(['count'=>0,'list'=>[]]);
|
||||
@ -168,6 +171,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:用户收藏
|
||||
@ -193,7 +197,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);
|
||||
|
@ -118,7 +118,8 @@ class Product extends BaseController
|
||||
$data['mer_status'] = ($this->request->merchant()->is_del || !$this->request->merchant()->mer_state || !$this->request->merchant()->status) ? 0 : 1;
|
||||
$data['mer_id'] = $this->request->merId();
|
||||
$data['update_time'] = date('Y-m-d H:i:s');
|
||||
$productType = $this->request->merchant()->type_id == Merchant::TypeSupplyChain ? 98 : 0;
|
||||
$typeSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeSupplyChain'])->value('mer_type_id');
|
||||
$productType = $this->request->merchant()->type_id == $typeSupplyChainId ? 98 : 0;
|
||||
$this->repository->edit($id, $data, $this->request->merId(), $productType);
|
||||
return app('json')->success('编辑成功');
|
||||
}
|
||||
|
@ -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,8 @@ class CloudProduct
|
||||
public function handle($event)
|
||||
{
|
||||
$productIds = $event['product_id'];
|
||||
$typeStoreId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeStore'])->value('mer_type_id');
|
||||
$typeCloudWarehouseId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeCloudWarehouse'])->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,11 +26,11 @@ 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;
|
||||
}
|
||||
$cloudMerchant = Merchant::getDB()->where(['type_id' => Merchant::TypeCloudWarehouse, 'category_id' => $categoryId, 'status' => 1, 'mer_state' => 1])->value('mer_id');
|
||||
$cloudMerchant = Merchant::getDB()->where(['type_id' => $typeCloudWarehouseId, 'category_id' => $categoryId, 'status' => 1, 'mer_state' => 1])->value('mer_id');
|
||||
if (empty($cloudMerchant)) {
|
||||
continue;
|
||||
}
|
||||
|
@ -19,12 +19,20 @@ class ProductCreate
|
||||
if (empty($merchant)) {
|
||||
return false;
|
||||
}
|
||||
if ($merchant['type_id'] == Merchant::TypePlatform || $merchant['type_id'] == Merchant::TypeCloudWarehouse) {
|
||||
$typeCloudWarehouseId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeCloudWarehouse'])->value('mer_type_id');
|
||||
$typePlatformId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypePlatform'])->value('mer_type_id');
|
||||
if ($merchant['type_id'] == $typePlatformId || $merchant['type_id'] == $typeCloudWarehouseId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 根据支持同步到云商的商户进行同步操作
|
||||
$syncMerArray = Db::name('MerchantType')->where('is_sync_prod', 1)->column('mer_type_id');
|
||||
if (!in_array($merchant['type_id'], $syncMerArray)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//市级云仓
|
||||
$cityMerchant = Db::name('merchant')->where('status', 1)->where('mer_state', 1)->where('category_id', $merchant['category_id'])->where('type_id', Merchant::TypePlatform)->find();
|
||||
$cityMerchant = Db::name('merchant')->where('status', 1)->where('mer_state', 1)->where('category_id', $merchant['category_id'])->where('type_id', $typePlatformId)->find();
|
||||
if ($cityMerchant) {
|
||||
$where = ['mer_id' => $cityMerchant['mer_id'], 'is_del' => 0];
|
||||
if ($product['bar_code'] != '' && in_array($product['product_type'], [0, 98]) && $product['spec_type'] == 0) {
|
||||
@ -38,7 +46,8 @@ class ProductCreate
|
||||
$data['status'] = $cityMerchant['is_audit'] ? 0 : 1;
|
||||
$data['mer_status'] = ($cityMerchant['is_del'] || !$cityMerchant['mer_state'] || !$cityMerchant['status']) ? 0 : 1;
|
||||
$data['rate'] = 3;
|
||||
$productType = $cityMerchant['type_id'] == Merchant::TypeSupplyChain ? 98 : 0;
|
||||
$typeSupplyChainId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeSupplyChain'])->value('mer_type_id');
|
||||
$productType = $cityMerchant['type_id'] == $typeSupplyChainId ? 98 : 0;
|
||||
$data['update_time'] = date('Y-m-d H:i:s');
|
||||
app()->make(ProductRepository::class)->create($data, $productType, $contentType);
|
||||
}
|
||||
|
@ -47,12 +47,16 @@ class paySuccessOrder
|
||||
$this->totalAmount = bcmul($realPrice, (string)$commission_rate, 2);
|
||||
$this->remain = $this->totalAmount;
|
||||
|
||||
$typeTownServerId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTownServer'])->value('mer_type_id');
|
||||
$typeVillageServerId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeVillageServer'])->value('mer_type_id');
|
||||
$typeTeamServerId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeTeamServer'])->value('mer_type_id');
|
||||
|
||||
//镇团队佣金
|
||||
$this->calculate(Merchant::TypeTownServer, 'commission_to_town_rate');
|
||||
$this->calculate($typeTownServerId, 'commission_to_town_rate');
|
||||
//村团队佣金
|
||||
$this->calculate(Merchant::TypeVillageServer, 'commission_to_village_rate');
|
||||
$this->calculate($typeVillageServerId, 'commission_to_village_rate');
|
||||
//小组服务团队佣金
|
||||
$this->calculate(Merchant::TypeTeamServer, 'commission_to_service_team_rate');
|
||||
$this->calculate($typeTeamServerId, 'commission_to_service_team_rate');
|
||||
|
||||
//订单购物详情表是否有云仓数据
|
||||
$orderProduct = Db::name('store_order_product')
|
||||
@ -71,8 +75,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) {
|
||||
@ -103,9 +108,9 @@ class paySuccessOrder
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$typeCloudWarehouseId = Db::name('MerchantType')->where('type_code', Merchant::TypeCode['TypeCloudWarehouse'])->value('mer_type_id');
|
||||
//云仓佣金
|
||||
$this->calculate(Merchant::TypeCloudWarehouse, 'commission_to_cloud_rate');
|
||||
$this->calculate($typeCloudWarehouseId, 'commission_to_cloud_rate');
|
||||
}
|
||||
|
||||
if ($this->remain > 0) {
|
||||
|
@ -2,4 +2,4 @@
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||
if(window.location.protocol == 'https:'){
|
||||
document.write('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">')
|
||||
}</script><link rel=stylesheet href=/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.958c16a8.js></script><script src=/static/js/index.db7f358e.js></script></body></html>
|
||||
}</script><link rel=stylesheet href=/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.c21fc11a.js></script><script src=/static/js/index.f77dc7ab.js></script></body></html>
|
@ -2,4 +2,4 @@
|
||||
document.write('<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0' + (coverSupport ? ', viewport-fit=cover' : '') + '" />')
|
||||
if(window.location.protocol == 'https:'){
|
||||
document.write('<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">')
|
||||
}</script><link rel=stylesheet href=/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.958c16a8.js></script><script src=/static/js/index.efaedbe7.js></script></body></html>
|
||||
}</script><link rel=stylesheet href=/static/index.97465e7b.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script src=/static/js/chunk-vendors.958c16a8.js></script><script src=/static/js/index.b4ad55bf.js></script></body></html>
|
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.3 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.9 KiB |
Before Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 297 B |
Before Width: | Height: | Size: 289 B |
Before Width: | Height: | Size: 303 B |
Before Width: | Height: | Size: 307 B |
Before Width: | Height: | Size: 290 B |
Before Width: | Height: | Size: 300 B |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 32 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 29 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 9.1 KiB |
Before Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 12 KiB |
Before Width: | Height: | Size: 282 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 28 KiB |
Before Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 2.3 KiB |
Before Width: | Height: | Size: 2.5 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 2.4 KiB |
Before Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 1.8 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 403 B |
Before Width: | Height: | Size: 398 B |
Before Width: | Height: | Size: 412 B |
Before Width: | Height: | Size: 397 B |
Before Width: | Height: | Size: 387 B |
Before Width: | Height: | Size: 395 B |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 13 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 223 B |
Before Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 238 B |
Before Width: | Height: | Size: 223 B |
Before Width: | Height: | Size: 223 B |
Before Width: | Height: | Size: 234 B |
Before Width: | Height: | Size: 234 B |
Before Width: | Height: | Size: 240 B |
Before Width: | Height: | Size: 239 B |
Before Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 522 B |
Before Width: | Height: | Size: 372 B |
Before Width: | Height: | Size: 503 B |
Before Width: | Height: | Size: 433 B |