|
|
@@ -57,38 +57,38 @@ class Sys extends Model
|
|
|
*/
|
|
|
public function getDataInfo($code=""){
|
|
|
$sys = $this->where("id", 1)->find();
|
|
|
- $data = $sys->toArray();
|
|
|
//微信配置
|
|
|
- if(empty($data["wxconfig"])){
|
|
|
- $data["wxconfig"]=[
|
|
|
- "appid"=>"",
|
|
|
- "secret"=>"",
|
|
|
- "mchid"=>"",
|
|
|
- "apiv2key"=>"",
|
|
|
- "apiclient_key"=>"",
|
|
|
- "apiclient_cert"=>"",
|
|
|
- "notify_url"=>""
|
|
|
- ];
|
|
|
- }else{
|
|
|
- $data["wxconfig"] = unserialize($data["wxconfig"]);
|
|
|
+ $wxconfig=[
|
|
|
+ "appid"=>"",
|
|
|
+ "secret"=>"",
|
|
|
+ "mchid"=>"",
|
|
|
+ "apiv2key"=>"",
|
|
|
+ "apiclient_key"=>"",
|
|
|
+ "apiclient_cert"=>"",
|
|
|
+ "notify_url"=>""
|
|
|
+ ];
|
|
|
+ if(!empty($data->wxconfig)){
|
|
|
+ $wxconfig = unserialize($data->wxconfig);
|
|
|
}
|
|
|
//分享配置
|
|
|
- if(empty($data["shareconfig"])){
|
|
|
- $data["shareconfig"]=[
|
|
|
- "img"=>"",
|
|
|
- "title"=>"",
|
|
|
- "query"=>"",
|
|
|
- "content"=>"",
|
|
|
- ];
|
|
|
- }else{
|
|
|
- $data["shareconfig"] = unserialize($data["wxconfig"]);
|
|
|
+ $shareconfig=[
|
|
|
+ "img"=>"",
|
|
|
+ "title"=>"",
|
|
|
+ "query"=>"",
|
|
|
+ "content"=>"",
|
|
|
+ ];
|
|
|
+ if(!empty($data->shareconfig)){
|
|
|
+ $shareconfig = unserialize($data->shareconfig);
|
|
|
}
|
|
|
if($code=="weixin"){
|
|
|
- return $data["wxconfig"];
|
|
|
+ return $wxconfig;
|
|
|
}
|
|
|
if($code=="share"){
|
|
|
- return $data["shareconfig"];
|
|
|
+ return $shareconfig;
|
|
|
}
|
|
|
+ $data = $data->toArray();
|
|
|
+ $data["shareconfig"] = $shareconfig;
|
|
|
+ $data["wxconfig"] = $wxconfig;
|
|
|
return $data;
|
|
|
}
|
|
|
}
|