Commit aaac7922 authored by fengpeng's avatar fengpeng

商家申请问题配置

parent d2fc25eb
<?php
/**
* Created by PhpStorm.
* User: fengp
* Date: 2018/9/28
* Time: 18:15
*/
namespace app\constant;
class MerchantApplyQuestionsConst
{
/**
* 所有问题列表
*/
const QUESTIONS_LIST = [
1 => [
'id' => 1,
'title' => '已有数字资产合计占家庭现有总资产(不含自住、自用房产及汽车等固定资产)的比例是',
'radio' => true,
'group_id' => 1,
'items' => [
'70%以上',
'50%-70%',
'30%-50%',
'10%-30%',
]
],
2 => [
'id' => 2,
'title' => '计划投入C2C的资金',
'radio' => true,
'group_id' => 1,
'items' => [
'1万元以下',
'1万-5万',
'5万-10万',
'10万-30万',
'30万-100万',
'100万以上',
]
],
3 => [
'id' => 3,
'title' => '您是否有尚未清偿的数额较大的债务,如有,其性质是',
'radio' => true,
'group_id' => 1,
'items' => [
'没有',
'有,住房抵押贷款等长期定额债务',
'有,信用卡欠款、消费信贷等短期信用债务',
'有,亲朋之间借款',
]
],
4 => [
'id' => 4,
'title' => '您的收入主要来自',
'radio' => true,
'group_id' => 1,
'items' => [
'工资奖金',
'生产经营',
'金融或房地产投资',
'其他',
]
],
5 => [
'id' => 5,
'title' => '您的投资经验包含',
'radio' => false,
'group_id' => 2,
'items' => [
'银行活期或定期存款',
'基金、保险或P2P',
'股票',
'期权、期货或创业板等高风险产品',
'期权、数字货币或艾西欧',
'有金融学习或工作经验',
]
],
6 => [
'id' => 6,
'title' => '最早投资数字货币的时间',
'radio' => true,
'group_id' => 2,
'items' => [
'还没有投资过',
'2013年以前',
'2013年-2015年',
'2015年-2016年',
'2017年以后',
]
],
7 => [
'id' => 7,
'title' => '您认为自己能承受的最大投资损失是多少',
'radio' => true,
'group_id' => 3,
'items' => [
'尽可能保证本金安全',
'一定的投资损失',
'较大的投资损失',
]
],
8 => [
'id' => 8,
'title' => '面对币价波动或突变,是否有自己的应对策略',
'radio' => true,
'group_id' => 3,
'items' => [
'没有',
'有',
]
],
9 => [
'id' => 9,
'title' => '您的最高学历是',
'radio' => true,
'group_id' => 4,
'items' => [
'高中或以下',
'大学专科',
'大学本科',
'硕士及以上',
]
],
];
/**
* 问题组列表
*/
const GRUNP_LIST = [
1 => [
'id' => 1,
'title' => '财务状况',
],
2 => [
'id' => 2,
'title' => '投资经验',
],
3 => [
'id' => 3,
'title' => '风险控制',
],
4 => [
'id' => 4,
'title' => '其他信息',
]
];
/**
* 格式化问题原始数据
* @return array
*/
public static function packageOriginalData(){
$result = [];
foreach (self::GRUNP_LIST as $k => $v) {
$res = [];
$res['group'] = $v;
foreach (self::QUESTIONS_LIST as $q => $item) {
if ($item['group_id'] == $k) {
$res['items'][] = $item;
}
}
$result[] = $res;
}
return $result;
}
/**
* 格式化问题提交数据
* @param array $checked
* @return array
*/
public static function packageHistoryData($checked = []){
$result = [];
foreach ($checked as $k => $v) {
$res = [];
$res['group'] = self::GRUNP_LIST[$k];
foreach ($v as $q => $item) {
$res['items'][] = array_merge(self::QUESTIONS_LIST[$q], ['checked' => $item]);
}
$result[] = $res;
}
return $result;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment