初始化项目:添加后端代码、ThinkPHP框架、前端资源
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace app\admin\model\app\msgpush;
|
||||
|
||||
use think\Model;
|
||||
|
||||
|
||||
class Config extends Model
|
||||
{
|
||||
|
||||
protected $configName = 'msg_push_option';
|
||||
|
||||
|
||||
/**
|
||||
* 获取场景配置
|
||||
* @param $senceName
|
||||
* @return array|mixed
|
||||
*/
|
||||
public function getSenceConfig($senceName){
|
||||
|
||||
$config = \app\common\model\app\Config::getConfig($this->configName);
|
||||
|
||||
if(isset($config[$senceName])){
|
||||
$config[$senceName]['status'] = intval($config[$senceName]['status']);
|
||||
return $config[$senceName];
|
||||
}
|
||||
return [
|
||||
'status'=>0,
|
||||
'template_id'=>'',
|
||||
'config'=>[]
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function getSenceList(){
|
||||
$options = config('message_push_options');
|
||||
|
||||
$list = [];
|
||||
|
||||
foreach ($options as $index => $item){
|
||||
$list[$index] = $item['name'];
|
||||
}
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user