feature/main20240421
郭嘉 6 months ago
parent a2a6fefa51
commit 85ce197a25
  1. 3
      app/store/controller/setting/Payment.php
  2. 6
      app/store/model/Payment.php

@ -34,8 +34,7 @@ class Payment extends Controller
{
$model = new PaymentModel;
$postform = $this->postForm();
//$postform['merchant_id'] = $this->merchantId;
if ($model->updateOptions($postform/*, $this->merchantId*/)) {
if ($model->updateOptions($postform, $this->merchantId)) {
return $this->renderSuccess('更新成功');
}
return $this->renderError($model->getError() ?: '更新失败');

@ -30,7 +30,7 @@ class Payment extends PaymentModel
public function updateOptions(array $form, $merchantId = 0): bool
{
// 生成写入的数据
$dataList = $this->buildData($form/*, $merchantId*/);
$dataList = $this->buildData($form, $merchantId);
// 删除所有的支付方式记录
static::deleteAll([]);
// 批量写入商品图片记录
@ -65,7 +65,7 @@ class Payment extends PaymentModel
* @param array $form
* @return array[]
*/
private function buildData(array $form/*, $merchantId = 0*/): array
private function buildData(array $form, $merchantId = 0): array
{
$data = [];
foreach ($form as $item) {
@ -79,7 +79,7 @@ class Payment extends PaymentModel
'is_default' => (int)$method['is_default'],
'others' => [],
'store_id' => self::$storeId,
//'merchant_id' => $merchantId,
'merchant_id' => $merchantId,
];
}
}

Loading…
Cancel
Save