This repository has been archived on 2024-07-11. You can view files and clone it, but cannot push or open issues or pull requests.
yoshop/source/application/admin/model/Setting.php

32 lines
660 B
PHP
Raw Normal View History

2020-04-25 22:20:29 +08:00
<?php
namespace app\admin\model;
use app\common\model\Setting as SettingModel;
/**
* 商城设置模型
* Class Setting
* @package app\admin\model
*/
class Setting extends SettingModel
{
/**
* 新增默认配置
* @param $wxapp_id
* @param $store_name
* @return array|false
* @throws \Exception
*/
public function insertDefault($wxapp_id, $store_name)
{
// 添加商城默认设置记录
$data = [];
foreach ($this->defaultData($store_name) as $key => $item) {
$data[] = array_merge($item, ['wxapp_id' => $wxapp_id]);
}
return $this->saveAll($data);
}
}