调试采购商品信用购
This commit is contained in:
parent
55c4ab94a1
commit
0b4dcf19ea
@ -114,7 +114,7 @@ class StoreCartDao extends BaseDao
|
|||||||
->append(['bc_extension_one', 'bc_extension_two']);
|
->append(['bc_extension_one', 'bc_extension_two']);
|
||||||
},
|
},
|
||||||
'merchant' => function (Relation $query) use ($uid) {
|
'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);
|
$query->where('uid', $uid);
|
||||||
},
|
},
|
||||||
'config' => function ($query) {
|
'config' => function ($query) {
|
||||||
|
@ -49,6 +49,9 @@ class MerchantDao extends BaseDao
|
|||||||
->when($is_del !== null, function ($query) use ($is_del) {
|
->when($is_del !== null, function ($query) use ($is_del) {
|
||||||
$query->where('is_del', $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) {
|
->when(isset($where['is_trader']) && $where['is_trader'] !== '', function ($query) use ($where) {
|
||||||
$query->where('is_trader', $where['is_trader']);
|
$query->where('is_trader', $where['is_trader']);
|
||||||
})
|
})
|
||||||
|
@ -96,6 +96,9 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if ($order_type == 98 && count($merchantCartList) > 1) {
|
||||||
|
throw new ValidateException('采购商品不支持跨店购买');
|
||||||
|
}
|
||||||
unset($merchantCart, $cart);
|
unset($merchantCart, $cart);
|
||||||
|
|
||||||
$order_price = 0;
|
$order_price = 0;
|
||||||
@ -925,7 +928,7 @@ class StoreOrderCreateRepository extends StoreOrderRepository
|
|||||||
$extend = [];
|
$extend = [];
|
||||||
}
|
}
|
||||||
$orderType = $orderInfo['order_type'];
|
$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('活动商品请单独购买');
|
throw new ValidateException('活动商品请单独购买');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -290,7 +290,7 @@ class MerchantRepository extends BaseRepository
|
|||||||
*/
|
*/
|
||||||
public function getList($where, $page, $limit, $userInfo)
|
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['status'] = 1;
|
||||||
$where['mer_state'] = 1;
|
$where['mer_state'] = 1;
|
||||||
$where['is_del'] = 0;
|
$where['is_del'] = 0;
|
||||||
|
@ -54,7 +54,7 @@ class Merchant extends BaseController
|
|||||||
public function lst()
|
public function lst()
|
||||||
{
|
{
|
||||||
[$page, $limit] = $this->getPage();
|
[$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'])) {
|
if (empty($where['type_id'])) {
|
||||||
$where['type_id'] = [MerchantModel::TypeCloudWarehouse, MerchantModel::TypeStore, MerchantModel::TypeSupplyChain, MerchantModel::TypePlatform];
|
$where['type_id'] = [MerchantModel::TypeCloudWarehouse, MerchantModel::TypeStore, MerchantModel::TypeSupplyChain, MerchantModel::TypePlatform];
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,7 @@ class MerchantUpdateValidate extends Validate
|
|||||||
'mer_address|店铺地址' => 'require|max:128',
|
'mer_address|店铺地址' => 'require|max:128',
|
||||||
'long|店铺经度' => 'max:24',
|
'long|店铺经度' => 'max:24',
|
||||||
'lat|店铺纬度' => 'max:24',
|
'lat|店铺纬度' => 'max:24',
|
||||||
|
'interest_rate|利率' => 'max:0.05',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected function isPhone($val)
|
protected function isPhone($val)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user