canyin-project/ybcy/models/common/Baidu.php

26 lines
730 B
PHP
Raw Permalink Normal View History

2024-11-01 16:07:54 +08:00
<?php
namespace app\models\common;
use BaiduMiniProgram\BaiduClient;
use BaiduMiniProgram\Payment;
use app\models\common\Config;
use yii\db\ActiveRecord;
class Baidu extends ActiveRecord
{
public static function login($uniacid,$code)
{
$config=Config::getSystemSet('baiduConfig',$uniacid);
$app = new BaiduClient('LafsBkVqtzTwBAKR2wPkxHppoL5m1iDe', '9g3nyF4tF63a9TTI0apSL0jTcfjWBQm9');
try{
$res=$app->session($code);
}catch (\Exception $e){
return $e;
}
return $res;
}
public static function pay($uniacid)
{
$config=Config::getSystemSet('baiduConfig',$uniacid);
$payment=new PaymentClient('3808847194','MMUnGG');
}
}