下单修复

This commit is contained in:
mkm 2023-10-28 17:51:20 +08:00
parent 3f1546e7b2
commit cff6927976
2 changed files with 17 additions and 12 deletions

View File

@ -65,7 +65,12 @@ class StoreCartRepository extends BaseRepository
$item['product'] = $product_make->getFailProduct($item['product_id']); $item['product'] = $product_make->getFailProduct($item['product_id']);
$fail[] = $item; $fail[] = $item;
} else { } else {
//商户信息
if ($item['merchant']){
$merchantData = $item['merchant']->append(['openReceipt'])->toArray(); $merchantData = $item['merchant']->append(['openReceipt'])->toArray();
} else {
$merchantData = ['mer_id' => 0];
}
unset($item['merchant']); unset($item['merchant']);
$coupon_make = app()->make(StoreCouponRepository::class); $coupon_make = app()->make(StoreCouponRepository::class);
if (!isset($arr[$item['mer_id']])) { if (!isset($arr[$item['mer_id']])) {
@ -98,9 +103,9 @@ class StoreCartRepository extends BaseRepository
* @param int $id * @param int $id
* @return mixed * @return mixed
*/ */
public function getOne(int $id,int $uid) public function getOne(int $id, int $uid)
{ {
$where = [$this->dao->getPk() => $id,'is_del'=>0,'is_fail'=>0,'is_new'=>0,'is_pay'=>0,'uid' => $uid]; $where = [$this->dao->getPk() => $id, 'is_del' => 0, 'is_fail' => 0, 'is_new' => 0, 'is_pay' => 0, 'uid' => $uid];
return ($this->dao->getWhere($where)); return ($this->dao->getWhere($where));
} }
@ -110,9 +115,9 @@ class StoreCartRepository extends BaseRepository
* @param $uid * @param $uid
* @author Qinii * @author Qinii
*/ */
public function getCartByProductSku($sku,$uid,$product_type=0) public function getCartByProductSku($sku, $uid, $product_type = 0)
{ {
$where = ['is_del'=>0,'is_fail'=>0,'is_new'=>0,'is_pay'=>0,'uid' => $uid,'product_type' => $product_type,'product_attr_unique' => $sku]; $where = ['is_del' => 0, 'is_fail' => 0, 'is_new' => 0, 'is_pay' => 0, 'uid' => $uid, 'product_type' => $product_type, 'product_attr_unique' => $sku];
return ($this->dao->getWhere($where)); return ($this->dao->getWhere($where));
} }
@ -120,10 +125,10 @@ class StoreCartRepository extends BaseRepository
public function getProductById($productId) public function getProductById($productId)
{ {
$where = [ $where = [
'is_del' =>0, 'is_del' => 0,
'is_new'=>0, 'is_new' => 0,
'is_pay'=>0, 'is_pay' => 0,
'product_id'=>$productId 'product_id' => $productId
]; ];
return $this->dao->getWhereCount($where); return $this->dao->getWhereCount($where);
} }

View File

@ -777,9 +777,9 @@ class StoreOrderCreateRepository extends StoreOrderRepository
'mer_integral_status' => 0, 'mer_integral_status' => 0,
]; ];
$allow_no_address = $allow_no_address && $merchantCart['order']['isTake']; $allow_no_address = $allow_no_address && $merchantCart['order']['isTake'];
foreach ($merchantCart['config'] as $config) { // foreach ($merchantCart['config'] as $config) {
$merchantCart['take'][$config['config_key']] = $config['value']; // $merchantCart['take'][$config['config_key']] = $config['value'];
} // }
$merIntegralConfig = $merchantCart['take']; $merIntegralConfig = $merchantCart['take'];
unset($merchantCart['config']); unset($merchantCart['config']);
$merIntegralConfig['mer_integral_rate'] = min(1, $merIntegralConfig['mer_integral_rate'] > 0 ? bcdiv($merIntegralConfig['mer_integral_rate'], 100, 4) : $merIntegralConfig['mer_integral_rate']); $merIntegralConfig['mer_integral_rate'] = min(1, $merIntegralConfig['mer_integral_rate'] > 0 ? bcdiv($merIntegralConfig['mer_integral_rate'], 100, 4) : $merIntegralConfig['mer_integral_rate']);