26 lines
730 B
PHP
26 lines
730 B
PHP
<?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');
|
|
}
|
|
|
|
} |