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