<?php
define('DEBUG',true); //调试开关, 开发时建议开启，关闭将获取最佳性能
define('VER_STATIC','?ver=177'); //strtotime(date('y-m-d h:i')))
!defined('MVC_OS') && define('MVC_OS',strtolower(substr(PHP_OS,0,3)));
!defined('MVC_OS_IS_WIN') && define('MVC_OS_IS_WIN',MVC_OS=='win'); //是否是windows
!defined('MVC_SAPI') && define('MVC_SAPI',strtolower(PHP_SAPI));
!defined('MVC_SAPI_IS_CLI') && define('MVC_SAPI_IS_CLI',MVC_SAPI=='cli'); //是否是命令行控制台模式

define('NUMIDX_CKRESULT2_OK','10121'); //交叉索引复核结论为OK的ID
define('NUMIDX_CKRESULT2_WAIT','10120'); //交叉索引复核结论需确认的ID
define('MODEL_CKRESULT2_OK','10180'); //车型复核结论为OK的ID
define('OBJECT_KTYPE','10116'); //KETYPE OBJECT ID
$tmp = explode(DIRECTORY_SEPARATOR,__DIR__);
array_pop($tmp);
array_pop($tmp);
$mvcdir = implode('/',$tmp).'/qgmvc/v1.0/mvc';
$Http = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')) ? 'https://' : 'http://';  
$Http =  $Http.$_SERVER['HTTP_HOST'];
return [
	'mvcDir'=> $mvcdir,
	'short_open_tag' => false, //php.ini 是否设置了支持短标签,false:没有,系统将给<? 替换成 <?php, 给 <?= 替换成 <?php echo 
	'lang'=> null, //当前语言 index.php 中指定
    "domain" => null, //含有语言版本的领域网址路径 index.php 中指定
	'locale'=> null, //本地化当前域 admin.php 中指定
    "project" => null, //工程名标识 admin.php 中指定
	'projectDir'=> null, //工程目录, index.php 中指定
	'site'=> null, //站点名标识, index.php 中指定
	"siteTitle" => null, //站点主标题, index.php 中指定
	'siteDir'=> null, //站点目录, index.php 中指定
	'sitePath'=> null, //站点路径, index.php 中指定
	'lang'=> null, //当前语言 index.php 中指定
	'dir'=> null, //物理目录 admin.php 中指定
	'path'=> null, //网址路径 admin.php 中指定
	/*自定义类映射地图,默认关闭
	'classMap'=>[
		'xxx\xx'            => \mvc::$cfg['siteDir'] . '/xxx/xxx.php',
	],
	*/
	/* 容器绑定
	* 注意不要使用 类::class 来配置，因为它会直接反射，增加include的IO操作
	*/
	'providers'=>[
		'\Overtrue\Pinyin\Pinyin' => ['single'=>true, 'params'=>[]],
	],
	//文件上传
	'upload' =>[
		//上传最大超时时间
		'time_limit' => 3600 * 24 * 1, // 1 天
		//为上传分配的内存
		'memory_limit' => (1024 * 16) .'M',
		//允许上传的文件类型
		'type' => ['jpg','jpeg','png','gif','tif','bmp',
			'dat','zip','rar','gz',
			'txt','csv','doc','xls','ppt','docx','xlsx','pptx','pdf',
			'css','json','xml',
			'mp3','mp4','av',
			'cad','dwg','psd','ai',
		],
		//php默认上传，文件大小限制
		'size' => 2 * 1024 * 1024, //2M
		//大文件上传，文件大小限制
		'bigSize' => (1024 * 1024 * 1024) * 5, //5G
		//模块
		'category'=>[
			'poe'=>[
				'items'=>[
					//普通图
					'img'=> [
						'maxfile'=>20,
						'filetype'=>'image',
						'size'=>['small'=>[200,150],'mid'=>[320,240],'big'=>[800,600]],
						'tojpeg'=>true,
						'type' => ['jpg','jpeg','png','gif'],
						'check'=> [
							'class' => \model\oe::class,
							'method' =>'uploadCheck',
						],
						'call'=> [
							'class' => \model\oe::class,
							'method' =>'uploadGet',
						],
						'keepFilename'=>true
					],
					//图纸
					'line'=> [
						'maxfile'=>20,
						'filetype'=>'file',
						'size'=>null,
						'tojpeg'=>false,
						'check'=> [
							'class' => \model\oe::class,
							'method' =>'uploadCheck',
						],
						'call'=> [
							'class' => \model\oe::class,
							'method' =>'uploadGet',
						],
						'type' => ['jpg','jpeg','png','gif','tif','bmp','pdf'],
						'keepFilename'=>true
					],
					//附件
					'other'=> [
						'maxfile'=>20,
						'filetype'=>'file',
						'size'=>null,
						'tojpeg'=>false,
						'check'=> [
							'class' => \model\oe::class,
							'method' =>'uploadCheck',
						],
						'call'=> [
							'class' => \model\oe::class,
							'method' =>'uploadGet',
						],
						'keepFilename'=>true,
						'type' => ['jpg','jpeg','png','gif','tif','bmp','txt','csv','doc','xls','ppt','docx','xlsx','pptx','pdf'],
					],
				],
				'type' => ['jpg','jpeg','png','gif','tif','bmp','txt','csv','doc','xls','ppt','docx','xlsx','pptx','pdf'],
				'path' => function($uploadID,$item,$extname,$params,$reqfilename=''){
					return strtolower('poe/'.$item.'/'.date('Y').'/'.substr($uploadID,0,1).substr($uploadID,-1));
				},
				'filebase' => function($uploadID,$item,$extname,$params,$reqfilename=''){
					return strtolower($uploadID); //不需要加扩展名
				}
			],
			'pro'=>[
				'items'=>[
					//普通图
					'img'=> [
						'maxfile'=>20,
						'filetype'=>'image',
						'size'=>['small'=>[200,150],'mid'=>[320,240],'big'=>[800,600]],
						'tojpeg'=>true,
						'type' => ['jpg','jpeg','png','gif'],
						'check'=> [
							'class' => \model\pro\pro::class,
							'method' =>'uploadCheck',
						],
						'call'=> [
							'class' => \model\pro\pro::class,
							'method' =>'uploadGet',
						],
						'keepFilename'=>true
					],
					//图纸
					'line'=> [
						'maxfile'=>20,
						'filetype'=>'file',
						'size'=>null,
						'tojpeg'=>false,
						'check'=> [
							'class' => \model\pro\pro::class,
							'method' =>'uploadCheck',
						],
						'call'=> [
							'class' => \model\pro\pro::class,
							'method' =>'uploadGet',
						],
						'keepFilename'=>true,
						'type' => ['jpg','jpeg','png','gif','tif','bmp','pdf'],
					],
					//附件
					'other'=> [
						'maxfile'=>20,
						'filetype'=>'file',
						'size'=>null,
						'tojpeg'=>false,
						'check'=> [
							'class' => \model\pro\pro::class,
							'method' =>'uploadCheck',
						],
						'call'=> [
							'class' => \model\pro\pro::class,
							'method' =>'uploadGet',
						],
						'keepFilename'=>true,
						'type' => ['jpg','jpeg','png','gif','tif','bmp','txt','csv','doc','xls','ppt','docx','xlsx','pptx','pdf'],
					],
				],
				'type' => ['jpg','jpeg','png','gif','tif','bmp','txt','csv','doc','xls','ppt','docx','xlsx','pptx','pdf'],
				'path' => function($uploadID,$item,$extname,$params,$reqfilename=''){
					return strtolower('pro/'.$item.'/'.date('Y').'/'.substr($uploadID,0,1).substr($uploadID,-1));
				},
				'filebase' => function($uploadID,$item,$extname,$params,$reqfilename=''){
					return strtolower($uploadID); //不需要加扩展名
				}
			],//proimage
			'general'=>[
				'items'=>[
					'img'=> [
						'maxfile'=>2,
						'filetype'=>'image',
						'size'=>['small'=>[200,150],'big'=>[800,600]],
						'tojpeg'=>true,
						'check'=> [
							'class' => \model\upload::class,
							'method' =>'uploadCheck',
						],
						'call'=> [
							'class' => \model\upload::class,
							'method' =>'uploadGet',
						],
					],
					'file'=> [
						'maxfile'=>1,
						'filetype'=>'file',
						'size'=>null,
						'tojpeg'=>false,
						'type' => ['jpg','jpeg','png','gif','tif','bmp','txt','csv','doc','xls','ppt','docx','xlsx','pptx','pdf'],
						'check'=> [
							'class' => \model\upload::class,
							'method' =>'uploadCheck',
						],
						'call'=> [
							'class' => \model\upload::class,
							'method' =>'uploadGet',
						],
					],
				],
				'type' => ['jpg','jpeg','png','gif','tif','bmp','txt','csv','doc','xls','ppt','docx','xlsx','pptx','pdf'],
				'path' => function($uploadID,$item,$extname,$params,$reqfilename=''){
					return 'general/'.date('Ym');
				},
				'filebase' => function($uploadID,$item,$extname,$params,$reqfilename=''){
					return $uploadID; //不需要加扩展名
				}
			],//general
			'import'=>[
				'items'=>[
					'importxls'=> [
						'maxfile'=>1,
						'filetype'=>'file',
						'size'=>null,
						'tojpeg'=>false,
						'type' => ['csv','xlsx'],
						'accept'=>'.xlsx,.csv',
						'check'=> [
							'class' => \model\uploadXls::class,
							'method' =>'uploadCheck',
						],
						'call'=> [
							'class' => \model\uploadXls::class,
							'method' =>'uploadGet',
						],
					],
					'importphoto'=> [
						'maxfile'=>1,
						'filetype'=>'file',
						'size'=>null,
						'tojpeg'=>false,
						'type' => ['zip','gz','gzip'],
						'accept'=>'.zip,.gz,.gzip',
						'check'=> [
							'class' => \model\import\uploadImportProPhoto::class,
							'method' =>'uploadCheck',
						],
						'call'=> [
							'class' => \model\import\uploadImportProPhoto::class,
							'method' =>'uploadGet',
						],
					],
					'importExcelSelf'=> [
						'maxfile'=>1,
						'filetype'=>'file',
						'size'=>null,
						'tojpeg'=>false,
						'type' => ['xlsx'],
						'accept'=>'.xlsx',
						'check'=> [
							'class' => \model\import\excelSelf::class,
							'method' =>'uploadCheck',
						],
						'call'=> [
							'class' => \model\import\excelSelf::class,
							'method' =>'uploadGet',
						],
					],
				],
				'type' => ['csv','xlsx','xls','gz','zip'],
				'path' => function($uploadID,$item,$extname,$params,$reqfilename=''){
					return 'import/'.date('Ym');
				},
				'filebase' => function($uploadID,$item,$extname,$params,$reqfilename=''){
					return $uploadID; //不需要加扩展名
				}
			],//导入文件
			'proimage'=>[
				'items'=>[
					'imgzip'=>[
                        'maxfile'=>1,
                        'filetype'=>'file',
                        'size'=>null,
                        'tojpeg'=>false,
                        'type'=>['zip'],
                        'accept'=>'.zip',
                        'check'=>[
                            'class'=>\model\import\uploadProPicZip::class,
                            'method'=>'uploadCheck',
                        ],
                        'call'=>[
                            'class'=>\model\import\uploadProPicZip::class,
                            'method'=>'uploadGet',
                        ],
                    ],
					//其它
					'other'=> [
						'maxfile'=>20,
						'filetype'=>'image',
						'size'=>['small'=>[200,150],'mid'=>[320,240],'big'=>[800,600]],
						'tojpeg'=>false,
						'check'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageCheck',
						],
						'call'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageGet',
						],
						'keepFilename'=>true,
						'type' => ['jpg','jpeg','png','gif','tif','bmp'],
					],
					//oem
					'oem'=>[
						'maxfile'=>20,
						'filetype'=>'image',
						'size'=>['small'=>[200,150],'mid'=>[320,240],'big'=>[800,600]],
						'tojpeg'=>false,
						'type' => ['jpg','jpeg','png','gif'],
						'check'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageCheck',
						],
						'call'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageGet',
						]
					],
					//competitor
					'competitor'=>[
						'maxfile'=>20,
						'filetype'=>'image',
						'size'=>['small'=>[200,150],'mid'=>[320,240],'big'=>[800,600]],
						'tojpeg'=>false,
						'type' => ['jpg','jpeg','png','gif'],
						'check'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageCheck',
						],
						'call'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageGet',
						]
					],
					//video
					'video'=>[
						'maxfile'=>20,
						'filetype'=>'video',
						'tojpeg'=>false,
						'type' => ['mp4','avi','mov','wmv','flv','mkv'],
						'check'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageCheck',
						],
						'call'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageGet',
						]
					],
					'init' => [
						'maxfile' => 15,
						'filetype' => 'image',
						'size' => ['small'=>[200,150],'mid'=>[320,240],'big'=>[800,600]],
						'tojpeg' => true,
						'keepFilename' => false, //同名文件名使用重复的文件ID
						'check'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageCheck',
						],
						'call'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageGet',
						]
					],
					'init_add' => [
						'maxfile' => 15,
						'filetype' => 'image',
						'size' =>  ['small'=>[200,150],'mid'=>[320,240],'big'=>[800,600]],
						'tojpeg' => true,
						'keepFilename' => false, //同名文件名使用重复的文件ID
						'check'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageCheck',
						],
						'call'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageGet',
						]
					],
					'beautify' => [
						'maxfile' => 15,
						'filetype' => 'image',
						'size' => ['small'=>[200,150],'mid'=>[320,240],'big'=>[800,600]],
						'tojpeg' => false,
						'keepFilename' => false,
						'check'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageCheck',
						],
						'call'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageGet',
						]
					],
					'beautify_add' => [
						'maxfile' => 15,
						'filetype' => 'image',
						'size' => ['small'=>[200,150],'mid'=>[320,240],'big'=>[800,600]],
						'tojpeg' => false,
						'keepFilename' => false, //同名文件名使用重复的文件ID
						'check'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageCheck',
						],
						'call'=> [
							'class' => \model\import\uploadProPicZip::class,
							'method' =>'uploadImageGet',
						]
					],
				],
				'type' => ['jpg','jpeg','png','gif','tif','bmp','txt','csv','doc','xls','ppt','docx','xlsx','pptx','pdf'],
				'path' => function($uploadID,$item,$extname,$params,$reqfilename=''){
					return strtolower('pro/'.$item.'/'.date('Y').'/'.substr($uploadID,0,1).substr($uploadID,-1));
				},
                'filebase' => function($uploadID,$item,$extname,$params,$reqfilename=''){
                    return strtolower($uploadID);
                }
			],
			'pdfset' => [
				'items' => [
					'photo' => [
						'maxfile' => 20,
						'filetype' => 'image',
						'size' => ['small' => [200, 133], 'big' => [600, 400]],
						'tojpeg' => false,
						'check' => [
							'class' => \model\pdflib\pdfset::class,
							'method' => 'uploadCheck',
						],
						'call' => [
							'class' => \model\pdflib\pdfset::class,
							'method' => 'uploadGet',
						],
					],
				],
				'type' => ['jpg', 'jpeg', 'png', 'gif'],
				'path' => function ($uploadID, $item, $extname, $params, $reqfilename = '') {
					return 'pdfset';
				},
				'filebase' => function ($uploadID, $item, $extname, $params, $reqfilename = '') {
					return $uploadID; //不需要加扩展名
				}
			],// 减震器pdf目录上传
		]//category
	],
	/* 安全有关的配置应当在这个键下面配置，，如加密键，短信接口KEY，TOKEN等等
	   safe 禁止在模板使用，并且不会被 /phpinfo模式打印
	   注: 站点配置会覆盖工程配置
	*/
	'safe'=> [
		'passwordSalt'=>'', //自定义盐 password 盐, 即使为空系统也会加内置盐
	],
	 /*站点特有配置,提供UI管理*/
    'siteCustom'=>[
        'pro'=>[
            'pic'=>[
               
            ]
        ],
    ],
	'urls'=>[
		'outfiles'=>$Http.'/pdc/files',//文件对外网址
	],
	//预警消息
	'warnMsgUser'=>['admin', 'frey.admin'],
	//包含的所有语种
	'LANGS'=>[
		'cn'=>['name'=>'中文', 'sname'=>'中', 'field'=>'cn_name', 'fanyi'=>'zh'],
		'en'=>['name'=>'英文', 'sname'=>'英', 'field'=>'en_name', 'fanyi'=>'en'],
		'py'=>['name'=>'俄文', 'sname'=>'俄', 'field'=>'py_name', 'fanyi'=>'ru'],
		'sp'=>['name'=>'西语', 'sname'=>'西', 'field'=>'sp_name', 'fanyi'=>'spa'],
		'al'=>['name'=>'阿拉伯', 'sname'=>'阿', 'field'=>'al_name', 'fanyi'=>'ara'],
	],
	//产品状态
	'PROSTATUS'=>['01'=>'开发中','02'=>'国内不做外贸订做','03'=>'上市','04'=>'退市','99'=>'删除','05'=>'升级中','06'=>'可研发生产','07'=>'新品在途可预定', '00'=>'未定义'],
	'PROSTATUSITEMS'=>'01:开发中,02:国内不做外贸订做,03:上市,04:退市,99:删除,05:升级中,06:可研发生产,07:新品在途可预定,00:未定义',
	//包装扩展配置
	'BrandExt'=>[
		'outbox'=>['pbe_length', 'pbe_width', 'pbe_height', 'pbe_size_unit'],
		'inbox'=>['pbe_length', 'pbe_width', 'pbe_height', 'pbe_size_unit'],
		'inpocket'=>['pbe_length', 'pbe_width', 'pbe_size_unit'],
		'tag'=>['pbe_length', 'pbe_width', 'pbe_size_unit'],
		'material'=>['pbe_length', 'pbe_width', 'pbe_height', 'pbe_size_unit'],
	],
	'YPAPI'=>[
		'base_url'=>'https://api.paojd.cn/',
		'token'=>'YPPDC-tesT-4545-DS987-454S'
	],
	'YPAPICOM'=>[
		'base_url'=>'https://api.paojd.cn/',
		'appkey'=>'269187',
		'appsecret'=>'4fb35883971281715c683120ae8094d0'
	],
	//安装位置转换
	'PosKeyVal' => [
		//前/后轴 先确认是否为轴位置
		'pos1'=>[
			'F'=>['Front', '前'], 'R'=>['Rear', '后']
		],
		//前/后
		'pos2'=>[
			'F'=>['Front', '前'], 'R'=>['Rear', '后']
		],
		//左/中/右
		'pos3'=>[
			'L'=>['Left', '左'], 'C'=>['Centre', 'Center', '中'], 'R'=>['Right', '右']
		],
		//外/中/内
		'pos4'=>[
			'O'=>['Out', '外'], 'C'=>['Centre', 'Center', '中'], 'I'=>['inner', '内']
		],
		//上/中/下
		'pos5'=>[
			'U'=>['Upper', '上'], 'C'=>['Centre', 'Center', '中'], 'L'=>['Lower', '下']
		]
	],
	//百度翻译 https://fanyi-api.baidu.com/manage/developer
	'fanyi'=>[
		'APP_ID'=>'20250208002268211',
		'SEC_KEY'=>'EMtQwbW5Vt9YL_WFqyfc',
	],
	//默认固定货源地
	'sourcePcId'=>['province'=>19, 'city'=>1901],
	//钉钉扫码

	'dingtalk'=>[
		'AppKey'=>'dingpcxxxx',
		'AppSecret'=>'Xd3b2QxxxxxxxAd_',
		'BackUrl'=>'https://pdm.xxxx.cn'
	],
	//国家表crm_country的中国ID，自动计算适用国家
	'CNID'=>52,
	// RCA资源管理API
	'RCAAPI'=>[
		'base_url'=>'http://192.168.1.130:44315/',
		'tenant'=>'T02',
		'tenantId'=>'3a1a21af-7fa4-f248-a21c-2f0cdd1bcfa7',
		'clientId'=>'client_02',
		'clientSecret'=>'client_02_123456',
		'name'=>'admin',
		'password'=>'1q2w3E*',
		'region'=>'ap-guangzhou',
		'bucket'=>'resource-1259142964',
	],
	// 公共资源管理API
	'YPRCAAPI'=>[
		'base_url'=>'https://rca.yiparts.com:44316/',
		'clientId'=>'client_02',
		'clientSecret'=>'client_02_123456'
	],
	//零件供应商的价格用于询单价格比例
	'askSupProPriceRate'=>1.11,
	//询单导入数据类型
	'workAskType'=>[
		["type"=>"Number", "name"=>"号码", "must"=>true, "chk"=>"any"],
		["type"=>"ProCount", "name"=>"数量", "must"=>true, "chk"=>"one"],
		["type"=>"ProName", "name"=>"名称", "must"=>false, "chk"=>"one"],
		["type"=>"Uprice", "name"=>"意向价", "must"=>false, "chk"=>"one"],
		["type"=>"Image", "name"=>"图片", "must"=>false, "chk"=>"any"],
	],
	//项目单配置
	'workProject'=>[
		'1'=>[
			'id'=>1,
			'name'=>'保时捷商盟',
			'tb_id'=>[3],//汽车品牌
			'pb_id'=>3,//商品品牌 CNAB
			'price_rate'=>1.2, //含税单价比例（成本价） spr_price
			'price2_rate'=>1.2, //指导价格比例（销售价）spr_price4
		]
	],
	//北美资源
	'napro'=>[
		'picurl'=>'http://192.168.1.67/www/Admin4MAPUrCcZ3T/OtherWebData/pic/',
	],
	// 阿里云上传配置
	'OSS'=>[
		'url'=>'https://yp-web-test.oss-cn-shenzhen.aliyuncs.com/',
		'region'=>'cn-shenzhen',
		'bucket'=>'yp-web-test',
		'AccessKeyId'=>'LTAI5tG1rRnVd1N1YoVFTF7u',
        'AccessKeySecret'=>'u6XrjcPmzYxLUrcoRdNkFdyESAvwmN'
	],
	//AI抠图
	'aiimg'=>[
		//图可丽
		'apikey'=>'61b3ffe226d14e6aa87513755f2a7b68',
		//自动抠图
		'automatting'=>true
	]
];