1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace app\common\model;
- use think\Model;
- use think\facade\Env;
- class MemberPayment extends Model{
- protected $pk = 'id';
-
- public static function config(int $miniapp_id,string $apiname){
- $rel = self::field('config')->where(['member_miniapp_id' => $miniapp_id,'apiname' => $apiname])->find();
- if(empty($rel)){
- return false;
- }
- $config = json_decode($rel['config'],true);
- $config['cert_path'] = empty($config['cert_path'])? '': Env::get('runtime_path').'cert'.DS.$miniapp_id.DS.$config['cert_path'];
- $config['key_path'] = empty($config['key_path'])? '': Env::get('runtime_path').'cert'.DS.$miniapp_id.DS.$config['key_path'];
- return $config;
- }
- }
|