diff --git a/app/common/dao/store/order/StoreCartDao.php b/app/common/dao/store/order/StoreCartDao.php index aa2e64e0..5aa780f8 100644 --- a/app/common/dao/store/order/StoreCartDao.php +++ b/app/common/dao/store/order/StoreCartDao.php @@ -114,7 +114,7 @@ class StoreCartDao extends BaseDao ->append(['bc_extension_one', 'bc_extension_two']); }, 'merchant' => function (Relation $query) use ($uid) { - $query->field('mer_id,mer_name,mer_state,mer_avatar,delivery_way,commission_rate,category_id,credit_buy')->with(['coupon' => function ($query) use ($uid) { + $query->field('mer_id,mer_name,mer_state,mer_avatar,delivery_way,commission_rate,category_id,credit_buy,settle_cycle,interest_rate')->with(['coupon' => function ($query) use ($uid) { $query->where('uid', $uid); }, 'config' => function ($query) { diff --git a/app/common/dao/system/merchant/MerchantDao.php b/app/common/dao/system/merchant/MerchantDao.php index 26b2c45d..c3e34e04 100644 --- a/app/common/dao/system/merchant/MerchantDao.php +++ b/app/common/dao/system/merchant/MerchantDao.php @@ -49,6 +49,9 @@ class MerchantDao extends BaseDao ->when($is_del !== null, function ($query) use ($is_del) { $query->where('is_del', $is_del); }) + ->when(isset($where['credit_buy']) && $where['credit_buy'] !== '', function ($query) use ($where) { + $query->where('credit_buy', $where['credit_buy']); + }) ->when(isset($where['is_trader']) && $where['is_trader'] !== '', function ($query) use ($where) { $query->where('is_trader', $where['is_trader']); }) diff --git a/app/common/repositories/store/order/StoreOrderCreateRepository.php b/app/common/repositories/store/order/StoreOrderCreateRepository.php index 20962a0f..b279b969 100644 --- a/app/common/repositories/store/order/StoreOrderCreateRepository.php +++ b/app/common/repositories/store/order/StoreOrderCreateRepository.php @@ -96,6 +96,9 @@ class StoreOrderCreateRepository extends StoreOrderRepository } } } + if ($order_type == 98 && count($merchantCartList) > 1) { + throw new ValidateException('采购商品不支持跨店购买'); + } unset($merchantCart, $cart); $order_price = 0; @@ -925,7 +928,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository $extend = []; } $orderType = $orderInfo['order_type']; - if (!in_array($orderType, [98, 0]) && (count($orderInfo['order']) > 1 || ($orderType != 10 && count($orderInfo['order'][0]['list']) > 1))) { + if ($orderType != 0 && (count($orderInfo['order']) > 1 || ($orderType != 10 && count($orderInfo['order'][0]['list']) > 1))) { throw new ValidateException('活动商品请单独购买'); } diff --git a/app/common/repositories/system/merchant/MerchantRepository.php b/app/common/repositories/system/merchant/MerchantRepository.php index e1658f69..3b2b27ac 100644 --- a/app/common/repositories/system/merchant/MerchantRepository.php +++ b/app/common/repositories/system/merchant/MerchantRepository.php @@ -290,7 +290,7 @@ class MerchantRepository extends BaseRepository */ public function getList($where, $page, $limit, $userInfo) { - $field = 'care_count,is_trader,type_id,mer_id,mer_banner,mini_banner,mer_name, mark,mer_avatar,product_score,service_score,postage_score,sales,status,is_best,create_time,long,lat,is_margin,service_phone,mer_address,mer_info'; + $field = 'care_count,is_trader,type_id,mer_id,mer_banner,mini_banner,mer_name, mark,mer_avatar,product_score,service_score,postage_score,sales,status,is_best,create_time,long,lat,is_margin,service_phone,mer_address,mer_info,credit_buy,settle_cycle,interest_rate'; $where['status'] = 1; $where['mer_state'] = 1; $where['is_del'] = 0; diff --git a/app/controller/api/store/merchant/Merchant.php b/app/controller/api/store/merchant/Merchant.php index f9b33448..81e7a929 100644 --- a/app/controller/api/store/merchant/Merchant.php +++ b/app/controller/api/store/merchant/Merchant.php @@ -54,7 +54,7 @@ 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']); + $where = $this->request->params(['keyword', 'order', 'is_best', 'location', 'category_id', 'type_id','is_trader', 'street_id', 'credit_buy']); if (empty($where['type_id'])) { $where['type_id'] = [MerchantModel::TypeCloudWarehouse, MerchantModel::TypeStore, MerchantModel::TypeSupplyChain, MerchantModel::TypePlatform]; } diff --git a/app/validate/merchant/MerchantUpdateValidate.php b/app/validate/merchant/MerchantUpdateValidate.php index 21e7aeb4..80c6a53a 100644 --- a/app/validate/merchant/MerchantUpdateValidate.php +++ b/app/validate/merchant/MerchantUpdateValidate.php @@ -29,6 +29,7 @@ class MerchantUpdateValidate extends Validate 'mer_address|店铺地址' => 'require|max:128', 'long|店铺经度' => 'max:24', 'lat|店铺纬度' => 'max:24', + 'interest_rate|利率' => 'max:0.05', ]; protected function isPhone($val)