Kaynağa Gözat

update

master
DengBiao 1 yıl önce
ebeveyn
işleme
fe801ac058
3 değiştirilmiş dosya ile 114 ekleme ve 76 silme
  1. +26
    -9
      src/applet/app/controllers/AliCallBackController.php
  2. +88
    -0
      src/common/Model/SelfSupportForSchoolInfo.php
  3. +0
    -67
      src/common/config/config.php

+ 26
- 9
src/applet/app/controllers/AliCallBackController.php Dosyayı Görüntüle

@@ -2,6 +2,7 @@

namespace SRVX\Api\Controllers;

use SRVX\Model\SelfSupportForSchoolInfo;
use SRVX\Traits\BasisFun;

class AliCallBackController extends \Phalcon\Mvc\Controller
@@ -53,15 +54,31 @@ class AliCallBackController extends \Phalcon\Mvc\Controller
$secretKey = "HOrPS0V4BthAPfgSdbHWwy0TwPnC8TQAQZIOjc8vOzI=";
//配置应用公私钥 中生成的私钥
$privateKey = 'MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCSGJ9ob4kmGy6y4YeynjKJc/LSg02EXjLErPZSfVrAOy69FTRfBDbazlxpfl6YCAxDdT5ZcspB5kS2XYOY4dmqqPmF4VywmcjmZM8IxZFl1p7YC8BOlP6JrzDPwVl3hn4z3Em1byj8ANLY/AxAaW9W43FSIX+cSfdJThTlxGcbHZFM3kqu++hgFc/E+ar1nB0garqh03ESjatO4b6tuHM57ou7M+fXsoIf3gaL1IDZpeAoRh5sLCBLIbLz55tF0DcOaFsK7NUImnabJDRtrM1IN0lDZkQYAzL+JFsAq+ncRJm60Vd1jq/pXML/cFVHQQgdnjUd2u2NJTSMiCKCftmdAgMBAAECggEARzt+LduEEXJbeJiCI1MC7QX9tSqUFyAevMpgZ6P7JZM1nLfECzfwzwqjAES/Nn1mDVYTCmXvu+XcRtadnWMxUAaHcwGIwgqZa8xnLa220OKuHETOhQIcgWFL+WAakS6gRgT4Y2BJqWV1aJqsFpPR15mZ3SO8JqXhznolsknqw8sO+DBJu+QXn1HdntSGWrLU4GblPlYAs64y/MzPMUWfA4ShDRn9MZK6ypnh2GB5ezgnFxx1jRGOy96IqikI8f+M/CVdgzErLIl+qTd/IbfL8B6Gccb4ZwimL/x1H1bqYCA6xINMZLo5eDHCvBTU4AW7sItw1Q7MQ8l3wBl7hW62gQKBgQDZT1SEaeBtOJxt3vrK7o/kCWNh/4h9oENFhDIuTvLQk9tirKw0BSiZedjbEHqnqM+bgeuvxazCp9uqoYXgC/dtIooy1P8aso+ZrroC/0vZV7TQBGBjbSSkKPn7ShZM2hfYQFpmLznwpel7KJbP6AJ8atv99wjB6uvqNf6fMU7IbQKBgQCsG3mj0amsYbS5ZQZpl2v65QnlkAxv0dxcstx15kW0hXRugLOu7EGcJNZMhO4gbn8dzMOaJANZPG1VLcFpe/QyP/AW7vDt9vTWdeQkQCD5xcXEDihLLCq0pFaSkmuOHWCI+aepSHUILlJ1P/K/5biD7MTdPg6tyLqyM+rjUd/38QKBgQCNu2fsVQHDOsEMB/qakK3YlSb0q61iAjzeAjKYcXV9BHJ6ERTfeN3Z+9asSjs1TqzZSAtoQQ1EiCaFS4P9dNCTpYttS+52gy+VlJhNjCT0RHfxlGkpb+4OA4vHkbKpvTUAHjjXnMW1ZwC5CugSAchdTXTeV1im4Yms4DqJqacwoQKBgQCocPd7An8qTDIBZMOC4oT29+TYvUO+yMkAHLmx1h4QkLCkWegB4g5QkKkAGPWp3hshAj/KA0cXthFXVUG/SGZ2K6eB+nbon1N+9cDETdM4QXzN5gE/mUlupIxqRU1ouI27YYPbJSQNTrC7OkwNzfnpe/gshEj/gr5eHHvd4UrvMQKBgD2Toow7sfpV0R9rhO8aJ9njlbH15LqUK/AotK3E7zr73Uv5j/BIKS4dVC7T56L2khEUbM/y8+Rig6CdyFf3A4i4GKfbp56Sap/Haa9OP6jfep6VW7Aa1AJxPvIPgPZ2U+EuRxrwrP1EBcL5z6Cern9c9Zzs8BPUacU+Q5e8c87W';
$publicKey = "xxxxxxx";
$iv = "";
// 1、验签、请求报文

$response = [
"code" => "10000",
"msg" => "Success",
"face_group_key" => "K12_91440402MA55R51X8H",
];

$response = [];
switch ($params["service"]) {
case "alipay.planet.ecocampus.spi.school.queryFaceGroupKey":
$biz_content = json_encode($params["biz_content"], true);
//SPI::获取学校人脸库id
$selfSupportForSchoolInfo = SelfSupportForSchoolInfo::findFirst("school_code = '{$biz_content["schoolCode"]}'");
if (empty($selfSupportForSchoolInfo)) {
$response = [
"code" => "40000",
"msg" => "Business Failed",
"sub_code" => "20000",
"sub_msg" => "未查询到对应的学校记录",
];
} else {
$response = [
"code" => "10000",
"msg" => "Success",
"face_group_key" => $selfSupportForSchoolInfo->group_key,
];
}
break;
default:

}

// 3、业务处理结果加签,业务返回结果需要进行排序
ksort($response);//数组排序


+ 88
- 0
src/common/Model/SelfSupportForSchoolInfo.php Dosyayı Görüntüle

@@ -0,0 +1,88 @@
<?php
namespace SRVX\Model;
use Phalcon\Mvc\Model;


class SelfSupportForSchoolInfo extends BasicModel
{

/**
*
* @var integer
*/
public $id;

/**
*
* @var int
*/
public $enterprise_id;

/**
*
* @var string
*/
public $school_code;

/**
*
* @var string
*/
public $school_std_code;

/**
*
* @var string
*/
public $group_key;

/**
*
* @var string
*/
public $memo;

/**
*
* @var string
*/
public $updated_at;

/**
*
* @var string
*/
public $deleted_at;

/**
* Initialize method for model.
*/
public function initialize()
{
parent::initialize();
$this->setSource("self_support_for_school_info");
}

/**
* Allows to query a set of records that match the specified conditions
*
* @param mixed $parameters
* @return SelfSupportForSchoolInfo[]|SelfSupportForSchoolInfo|\Phalcon\Mvc\Model\ResultSetInterface
*/
public static function find($parameters = null): \Phalcon\Mvc\Model\ResultsetInterface
{
return parent::find($parameters);
}

/**
* Allows to query the first record that match the specified conditions
*
* @param mixed $parameters
* @return SelfSupportForSchoolInfo|\Phalcon\Mvc\Model\ResultInterface|\Phalcon\Mvc\ModelInterface|null
*/
public static function findFirst($parameters = null): ?\Phalcon\Mvc\ModelInterface
{
return parent::findFirst($parameters);
}

}

+ 0
- 67
src/common/config/config.php Dosyayı Görüntüle

@@ -1,67 +0,0 @@
<?php
// 基础
const TIMEZONE = 'PRC'; // 时区设置
const CONTENT_TYPE = 'application/json'; //默认输出类型 application/json , text/html, text/plain, application/xml
// 基础路径
const DIR_SRC = __DIR__ . '/../../';
const DIR_RUNTIME = DIR_SRC . '../runtime/';
const DIR_CACHE = DIR_RUNTIME . 'cache/';
const DIR_LOG = DIR_RUNTIME . 'log/';
const DIR_METADATA = DIR_RUNTIME . 'metadata/';
const DIR_COMMON = DIR_SRC . 'common/';
const DIR_CONSTANTS = DIR_SRC . 'applet/app/constants/';
const DIR_MODEL = DIR_COMMON . 'model/';
const DIR_VENDOR = DIR_SRC . 'vendor/';

// 是否开启调试模式
const DEBUG = 1;
const APP_ENV = 'dev';

// APP API 接口地址
const DEV_APP_URL = 'http://inapi.izhyin.cn';
const PROD_APP_URL = 'http://zyos';

const OSS_URL = 'http://inapi.izhyin.cn';

//phalcon internal setting
Phalcon\Mvc\Model::setup([
'notNullValidations' => false,
'exceptionOnFailedSave' => true,
'ignoreUnknownColumns' => true
]);
// return config
return new Phalcon\Config([
'application' => [
'baseUri' => '/',
'commDir' => DIR_COMMON,
'modelsDir' => DIR_MODEL,
'cacheDir' => DIR_CACHE,
'metaDataDir' => DIR_METADATA,
'controllersDir' => DIR_SRC . APP_NAME . '/app/controllers',
'constantsDir' => DIR_CONSTANTS,
],
//主从DB
'database' => [
'adapter' => 'mysql',
'host' => '119.23.182.117',
'port' => '3306',
'username' => 'root',
'password' => 'Fnuo123com@',
'dbname' => 'zhios_pay',
'charset' => 'utf8',
'persistent' => false, //TRUE, //线上开启长连接
'log_file' => DIR_SRC . '../db_debug.log'
],
//redis
'redis' => [
'host' => '120.24.28.6',
'port' => '32572',
'timeout' => '2.5',
'persistent' => false,
'prefix' => 'zyos_',
'sess_prefix' => 'sid',
'ttl' => 86400,
'lifetime' => 3600,
],
'version' => 'v1.0.0',
]);

Yükleniyor…
İptal
Kaydet