setDocument($title, $content, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['document_key', '=', 'REGISTER_AGREEMENT']]); return $res; } /** * 查询注册协议 * @param unknown $where * @param unknown $field * @param unknown $value */ public function getRegisterDocument($site_id, $app_module = 'shop') { $document = new Document(); $info = $document->getDocument([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['document_key', '=', 'REGISTER_AGREEMENT']]); return $info; } /** * 注册规则 * array $data */ public function setRegisterConfig($data, $site_id, $app_module = 'shop') { $config = new ConfigModel(); $res = $config->setConfig($data, '注册规则', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'REGISTER_CONFIG']]); return $res; } /** * 查询注册规则 */ public function getRegisterConfig($site_id, $app_module = 'shop') { $config = new ConfigModel(); $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'REGISTER_CONFIG']]); if (empty($res['data']['value'])) { //默认值设置 $res['data']['value'] = [ 'login' => 'username,mobile', 'register' => 'username,mobile', 'third_party' => 1, 'bind_mobile' => 0, 'pwd_len' => 6, 'pwd_complexity' => '' ]; } else { $value = $res['data']['value']; $value['login'] = $value['login'] ?? 'username,mobile'; $value['register'] = $value['register'] ?? 'username,mobile'; $value['third_party'] = $value['third_party'] ?? 0; $value['bind_mobile'] = $value['bind_mobile'] ?? 0; $res['data']['value'] = $value; } return $res; } /** * 注销协议 * @param unknown $site_id * @param unknown $name * @param unknown $value */ public function setCancelDocument($title, $content, $site_id, $app_module = 'shop') { $document = new Document(); $res = $document->setDocument($title, $content, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['document_key', '=', 'CANCEL_AGREEMENT']]); return $res; } /** * 查询注销协议 * @param unknown $where * @param unknown $field * @param unknown $value */ public function getCancelDocument($site_id, $app_module = 'shop') { $document = new Document(); $info = $document->getDocument([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['document_key', '=', 'CANCEL_AGREEMENT']]); return $info; } /** * 注销规则 * array $data */ public function setCancelConfig($data, $site_id, $app_module = 'shop') { $config = new ConfigModel(); $res = $config->setConfig($data, '注销规则', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'CANCEL_CONFIG']]); return $res; } /** * 查询注销规则 */ public function getCancelConfig($site_id, $app_module = 'shop') { $config = new ConfigModel(); $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'CANCEL_CONFIG']]); if (empty($res['data']['value'])) { //默认值设置 $res['data']['value'] = [ 'is_enable' => 0, //注销开关 'is_audit' => 1, //审核开关 ]; } return $res; } /** * 查询会员配置 * @param unknown $where * @param unknown $field * @param unknown $value */ public function getMemberConfig($site_id, $app_module = 'shop') { $config = new ConfigModel(); $res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'MEMBER_LEVEL_CONFIG']]); if (empty($res['data']['value'])) { //默认值设置 $res['data']['value'] = [ 'is_update' => 1, ]; } else { $value = $res['data']['value']; $value['is_update'] = $value['is_update'] ?? 1; $res['data']['value'] = $value; } return $res; } /** * 会员配置 * array $data */ public function setMemberConfig($data, $site_id, $app_module = 'shop') { $config = new ConfigModel(); $res = $config->setConfig($data, '会员等级更新配置', 1, [['site_id', '=', $site_id], ['app_module', '=', $app_module], ['config_key', '=', 'MEMBER_LEVEL_CONFIG']]); return $res; } }