root пре 3 година
родитељ
комит
4c7fac2e54
100 измењених фајлова са 2 додато и 9876 уклоњено
  1. 0 157
      common/helpers/CaptchaAction.php
  2. 0 159
      common/helpers/PayStack.php
  3. BIN
      common/helpers/font/DroidSansMono.ttf
  4. 0 197
      common/helpers/ocr/OcrApi.php
  5. 0 783
      common/helpers/ocr/baidu/AipOcr.php
  6. 0 50
      common/helpers/ocr/baidu/errorCode.php
  7. 0 405
      common/helpers/ocr/baidu/lib/AipBase.php
  8. 0 222
      common/helpers/ocr/baidu/lib/AipHttpClient.php
  9. 0 160
      common/helpers/ocr/baidu/lib/AipHttpUtil.php
  10. 0 176
      common/helpers/ocr/baidu/lib/AipSampleSigner.php
  11. 0 17
      common/helpers/ocr/baidu/lib/AipSignOption.php
  12. 2 2
      common/libs/taskQueue/TaskFunc.php
  13. 0 22
      common/mail/layouts/html.php
  14. 0 14
      common/mail/layouts/text.php
  15. 0 15
      common/mail/passwordResetToken-html.php
  16. 0 12
      common/mail/passwordResetToken-text.php
  17. 0 126
      common/models/Ad.php
  18. 0 72
      common/models/AdLocation.php
  19. 0 97
      common/models/ApproachDecOrder.php
  20. 0 136
      common/models/ApproachOrder.php
  21. 0 71
      common/models/ApproachOrderCall.php
  22. 0 77
      common/models/ApproachOrderGoods.php
  23. 0 59
      common/models/Article.php
  24. 0 62
      common/models/ArticleCategory.php
  25. 0 178
      common/models/BalanceAudit.php
  26. 0 102
      common/models/CFLXAudit.php
  27. 0 111
      common/models/CalcBonusBT.php
  28. 0 73
      common/models/CalcBonusCF.php
  29. 0 79
      common/models/CalcBonusFL.php
  30. 0 80
      common/models/CalcBonusFW.php
  31. 0 77
      common/models/CalcBonusFX.php
  32. 0 80
      common/models/CalcBonusGL.php
  33. 0 80
      common/models/CalcBonusGX.php
  34. 0 73
      common/models/CalcBonusLS.php
  35. 0 73
      common/models/CalcBonusLX.php
  36. 0 83
      common/models/CalcBonusStandard.php
  37. 0 80
      common/models/CalcBonusVIP.php
  38. 0 80
      common/models/CalcBonusXF.php
  39. 0 97
      common/models/CalcBonusYC.php
  40. 0 80
      common/models/CalcBonusYJ.php
  41. 0 51
      common/models/CalcMonthBonusUser.php
  42. 0 72
      common/models/CompanyBank.php
  43. 0 50
      common/models/DeductReconsume.php
  44. 0 93
      common/models/FlowBonus.php
  45. 0 82
      common/models/FlowCF.php
  46. 0 71
      common/models/FlowDeductZR.php
  47. 0 83
      common/models/FlowExchangePoints.php
  48. 0 81
      common/models/FlowGaragePoints.php
  49. 0 82
      common/models/FlowLX.php
  50. 0 82
      common/models/FlowReconsumePoints.php
  51. 0 25
      common/models/FlowRemainPv.php
  52. 0 81
      common/models/FlowTourismPoints.php
  53. 0 81
      common/models/FlowVillaPoints.php
  54. 0 81
      common/models/FlowWallet.php
  55. 0 111
      common/models/HistoryBonus.php
  56. 0 66
      common/models/ImportScore.php
  57. 0 87
      common/models/Invoice.php
  58. 0 98
      common/models/InvoiceAudit.php
  59. 0 64
      common/models/InvoiceBalanceAudit.php
  60. 0 109
      common/models/InvoiceFlow.php
  61. 0 110
      common/models/Message.php
  62. 0 60
      common/models/MessageText.php
  63. 0 138
      common/models/OcrApi.php
  64. 0 83
      common/models/OpenBank.php
  65. 0 151
      common/models/Order.php
  66. 0 131
      common/models/OrderDec.php
  67. 0 77
      common/models/OrderGoods.php
  68. 0 71
      common/models/OrderGoodsDec.php
  69. 0 69
      common/models/OrderGoodsShop.php
  70. 0 131
      common/models/OrderShop.php
  71. 0 129
      common/models/OrderStandard.php
  72. 0 71
      common/models/OrderStandardGoods.php
  73. 0 52
      common/models/OriginDecPv.php
  74. 0 64
      common/models/PerfStandard.php
  75. 0 79
      common/models/ReceiveAddress.php
  76. 0 234
      common/models/Recharge.php
  77. 0 129
      common/models/ReconsumeAudit.php
  78. 0 73
      common/models/ReconsumePool.php
  79. 0 109
      common/models/ReconsumePoolFlow.php
  80. 0 78
      common/models/RegInfoAudit.php
  81. 0 98
      common/models/RegType.php
  82. 0 133
      common/models/Region.php
  83. 0 22
      common/models/RemainPv.php
  84. 0 88
      common/models/ResendQYAudit.php
  85. 0 92
      common/models/ReturnOrder.php
  86. 0 61
      common/models/ScoreMonth.php
  87. 0 252
      common/models/ShopGoods.php
  88. 0 137
      common/models/SmsApi.php
  89. 0 149
      common/models/SmsTemplate.php
  90. 0 59
      common/models/Test.php
  91. 0 60
      common/models/TmpAreaNetwork.php
  92. 0 52
      common/models/TmpDeleteUser.php
  93. 0 47
      common/models/TmpFreezeUser.php
  94. 0 60
      common/models/TmpOldNetwork.php
  95. 0 64
      common/models/TmpOldNetworkAll.php
  96. 0 64
      common/models/TmpOldNetworkError.php
  97. 0 64
      common/models/TmpOldNetworkReplenish.php
  98. 0 60
      common/models/TmpOldUser.php
  99. 0 144
      common/models/Transfer.php
  100. 0 64
      common/models/UpgradeType.php

+ 0 - 157
common/helpers/CaptchaAction.php

@@ -1,157 +0,0 @@
-<?php
-namespace common\helpers;
-
-use Yii;
-use yii\helpers\Url;
-use yii\web\Response;
-
-/**
- * 验证码扩展类
- * @author   Leo
- * @copyright  Copyright (c) 2016 (http://www.LeoCode.net)
- */
-class CaptchaAction extends \yii\captcha\CaptchaAction
-{
-
-    const CAPTCHA_CODE = 'ak:captcha_code_%s';
-
-    /**
-     * GD库方式渲染
-     * @param string $code
-     * @return string
-     */
-    protected function renderImageByGD($code)
-    {
-        $this->fontFile = Yii::getAlias('@common/helpers/font/DroidSansMono.ttf');
-        $image = imagecreatetruecolor($this->width, $this->height);
-        $backColor = imagecolorallocate(
-            $image,
-            (int)($this->backColor % 0x1000000 / 0x10000),
-            (int)($this->backColor % 0x10000 / 0x100),
-            $this->backColor % 0x100
-        );
-        imagefilledrectangle($image, 0, 0, $this->width - 1, $this->height - 1, $backColor);
-        imagecolordeallocate($image, $backColor);
-        $this->transparent = true;
-        if ($this->transparent) {
-            imagecolortransparent($image, $backColor);
-        }
-
-        $foreColor = imagecolorallocate(
-            $image,
-            (int)($this->foreColor % 0x1000000 / 0x10000),
-            (int)($this->foreColor % 0x10000 / 0x100),
-            $this->foreColor % 0x100
-        );
-
-        $length = strlen($code);
-        $box = imagettfbbox(30, 0, $this->fontFile, $code);
-        $w = $box[4] - $box[0] + $this->offset * ($length - 1);
-        $h = $box[1] - $box[5];
-        $scale = min(($this->width - $this->padding * 2) / $w, ($this->height - $this->padding * 2) / $h);
-        $x = 10;
-        $y = round($this->height * 27 / 40);
-
-        // 添加彩色乱字符
-        $chartDictionary = 'abcdefghjkmnopqrstuvwxyzABCDEFGHJKMNOPQRSTUVWXYZ2345679';
-        for ($i = 0; $i < 50; $i++) {
-            $chartPosition = rand(0, strlen($chartDictionary));
-            $chartContent = substr($chartDictionary, $chartPosition, 1);
-            $chartColor = imagecolorallocate($image, mt_rand(150, 255), mt_rand(150, 255), mt_rand(150, 255));
-            $chartAngle = rand(-10, 10);
-            imagettftext($image, 10, $chartAngle, rand(0, ($this->width - $this->padding * 2) - 10), rand(0, ($this->height - $this->padding * 2) - 10), $chartColor, $this->fontFile, $chartContent);
-        }
-
-        // 设置文字
-        for ($i = 0; $i < $length; ++$i) {
-            $fontSize = (int)(rand(26, 32) * $scale * 0.8);
-            $angle = rand(-10, 10);
-            $letter = $code[$i];
-            $box = imagettftext($image, $fontSize, $angle, $x, $y, $foreColor, $this->fontFile, $letter);
-            $x = $box[2] + $this->offset;
-        }
-
-        // 验证码添加线条
-        for ($i = 0; $i < 10; $i++) {
-            $lineColor = imagecolorallocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
-            imageline($image, rand(0, 2), rand(0, ($this->width - $this->height * 2) - 2), rand(0, ($this->width - $this->padding * 2) - 2), rand(0, ($this->width - $this->height * 2) - 2), $lineColor);
-        }
-
-        // 验证码添加噪点
-        for ($i = 0; $i < 300; $i++) {
-            //设置点的颜色
-            $pointColor = imagecolorallocate($image, rand(0, 255), rand(0, 255), rand(0, 255));
-            imagesetpixel($image, rand(0, ($this->width - $this->padding * 2)), rand(0, ($this->width - $this->height * 2) - 10), $pointColor);
-        }
-
-        imagecolordeallocate($image, $foreColor);
-
-        ob_start();
-        imagepng($image);
-        imagedestroy($image);
-
-        return ob_get_clean();
-    }
-
-    /**
-     * Runs the action.
-     */
-    public function run()
-    {
-        if (Yii::$app->request->getQueryParam(self::REFRESH_GET_VAR) !== null) {
-            // AJAX request for regenerating code
-            $code = $this->getVerifyCode(true);
-            Yii::$app->response->format = Response::FORMAT_JSON;
-            return [
-                'hash1' => $this->generateValidationHash($code),
-                'hash2' => $this->generateValidationHash(strtolower($code)),
-                // we add a random 'v' parameter so that FireFox can refresh the image
-                // when src attribute of image tag is changed
-                'url' => Url::to([$this->id, 'v' => uniqid()]),
-            ];
-        } else {
-            $this->setHttpHeaders();
-            Yii::$app->response->format = Response::FORMAT_RAW;
-            return $this->renderImage($this->getVerifyCode(true));
-        }
-    }
-
-    /**
-     * @param bool $regenerate
-     * @return int|mixed|string|null
-     */
-    public function getVerifyCode($regenerate = false)
-    {
-        if ($this->fixedVerifyCode !== null) {
-            return $this->fixedVerifyCode;
-        }
-//        $name = $this->getSessionKey();
-        $pageId = \Yii::$app->request->get('page_id');
-        if( !$pageId ) {
-            throw new \Exception('no page id');
-        }
-
-        $cacheRedis = Yii::$app->cache;
-        $key = sprintf(self::CAPTCHA_CODE, $pageId);
-        if( !$regenerate ) {
-            $code = $cacheRedis->get($key);
-            if ( $code ) return $code;
-        }
-
-        $code = $this->generateVerifyCode();
-        $cacheRedis->set($key, $code, 300);
-
-        return $code;
-    }
-
-    public function validate($input, $caseSensitive)
-    {
-        $code = $this->getVerifyCode();
-        $valid = $caseSensitive ? ($input === $code) : strcasecmp($input, $code) === 0;
-        if ( $valid ) {
-            $this->getVerifyCode(true);
-        }
-
-        return $valid;
-    }
-}

+ 0 - 159
common/helpers/PayStack.php

@@ -1,159 +0,0 @@
-<?php
-
-namespace common\helpers;
-
-class PayStack
-{
-    /**
-     * 根据运行环境加载secretKey
-     */
-    public static function getSecretKey(): string
-    {
-         return YII_ENV == YII_ENV_PROD ? \Yii::$app->Paystack->liveSecretKey : \Yii::$app->Paystack->testSecretKey;
-//       return \Yii::$app->Paystack->testSecretKey;
-    }
-
-    /**
-     * 支付.
-     */
-    public static function transactionInit($currency, $amount, $email)
-    {
-        $secretKey = self::getSecretKey();
-
-        try {
-            $url = "https://api.paystack.co/transaction/initialize";
-            $fields = [
-                'email' => $email,
-                'amount' => $amount * 100
-            ];
-            $fields_string = http_build_query($fields);
-            //open connection
-            $curl = curl_init();
-
-            //set the url, number of POST vars, POST data
-            curl_setopt($curl,CURLOPT_URL, $url);
-            curl_setopt($curl,CURLOPT_POST, true);
-            curl_setopt($curl,CURLOPT_POSTFIELDS, $fields_string);
-            curl_setopt($curl, CURLOPT_HTTPHEADER, array(
-                "Authorization: Bearer {$secretKey}",
-                "Cache-Control: no-cache",
-            ));
-            //So that curl_exec returns the contents of the cURL; rather than echoing it
-            curl_setopt($curl,CURLOPT_RETURNTRANSFER, true);
-            //execute post
-            $result = curl_exec($curl);
-            $err = curl_error($curl);
-            curl_close($curl);
-            if ($err) {
-                return [
-                    'status'    => false,
-                    'message'   => $err,
-                ];
-            }
-
-            return json_decode($result, true);
-        } catch (\Exception $e) {
-            return [
-                'status'    => false,
-                'message'   => $e->getMessage(),
-            ];
-        }
-    }
-    /**
-     * 交易结果校验.
-     * @param $ref
-     * @return array
-     */
-    public static function transactionVerify($ref): array
-    {
-        $secretKey = self::getSecretKey();
-
-        try {
-            $curl = curl_init();
-            curl_setopt_array($curl, [
-                CURLOPT_URL => "https://api.paystack.co/transaction/verify/{$ref}",
-                CURLOPT_RETURNTRANSFER => true,
-                CURLOPT_ENCODING => "",
-                CURLOPT_MAXREDIRS => 10,
-                CURLOPT_TIMEOUT => 30,
-                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
-                CURLOPT_CUSTOMREQUEST => "GET",
-                CURLOPT_HTTPHEADER => array(
-                    "Authorization: Bearer {$secretKey}",
-                    "Cache-Control: no-cache",
-                ),
-            ]);
-
-            $response = curl_exec($curl);
-            $err = curl_error($curl);
-            curl_close($curl);
-
-            if ($err) {
-                return [
-                    'status'    => false,
-                    'message'   => $err,
-                ];
-            }
-
-            return json_decode($response, true);
-        } catch (\Exception $e) {
-            return [
-                'status'    => false,
-                'message'   => $e->getMessage(),
-            ];
-        }
-    }
-
-    /**
-     * 交易退款.
-     * @param string $reference
-     * @param int $amount
-     * @return array
-     */
-    public static function transactionRefund(string $reference, int $amount)
-    {
-        $secretKey = self::getSecretKey();
-
-        try {
-            $url = "https://api.paystack.co/refund";
-            $fields = [
-                'transaction' => $reference,
-                'amount'      => $amount,
-            ];
-            $fields_string = http_build_query($fields);
-            //open connection
-            $curl = curl_init();
-
-            //set the url, number of POST vars, POST data
-            curl_setopt($curl, CURLOPT_URL, $url);
-            curl_setopt($curl, CURLOPT_POST, true);
-            curl_setopt($curl, CURLOPT_POSTFIELDS, $fields_string);
-            curl_setopt($curl, CURLOPT_HTTPHEADER, array(
-                "Authorization: Bearer {$secretKey}",
-                "Cache-Control: no-cache",
-            ));
-
-            //So that curl_exec returns the contents of the cURL; rather than echoing it
-            curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
-
-            //execute post
-            $response = curl_exec($curl);
-            $err = curl_error($curl);
-            curl_close($curl);
-
-            if ($err) {
-                return [
-                    'status'    => false,
-                    'message'   => $err,
-                ];
-            }
-
-            return json_decode($response, true);
-        } catch (\Exception $e) {
-            return [
-                'status'    => false,
-                'message'   => $e->getMessage(),
-            ];
-        }
-    }
-}

BIN
common/helpers/font/DroidSansMono.ttf


+ 0 - 197
common/helpers/ocr/OcrApi.php

@@ -1,197 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: leo
- * Date: 2018/5/22
- * Time: 上午9:39
- */
-
-namespace common\helpers\ocr;
-
-use common\helpers\Cache;
-use common\helpers\ocr\baidu\AipOcr;
-use common\helpers\Tool;
-use yii\base\BaseObject;
-use yii\base\StaticInstanceTrait;
-
-class OcrApi extends BaseObject {
-    use StaticInstanceTrait;
-
-    const TYPE_BAIDU = 'baidu';
-    const BAIDU_CONFIGS = [
-        'appId' => 'string',
-        'apiKey' => 'string',
-        'secretKey' => 'string',
-    ];
-
-    private $_type;
-    private $_typeClass;
-    private $_ocrApiObj;
-    private $_errorCode;
-
-    /**
-     * 初始化
-     * @throws \yii\base\InvalidConfigException
-     */
-    public function init() {
-        parent::init();
-        // 获取当前使用的ocr识别接口
-        $ocrApiConfig = Cache::getOcrApiConfig();
-        $this->_type = $ocrApiConfig['API_NAME'];
-        $this->_typeClass = null;
-        $apiConfig = [];
-        if ($ocrApiConfig['API_NAME'] == self::TYPE_BAIDU) {
-            $this->_typeClass = AipOcr::class;
-            foreach ($ocrApiConfig['CONFIG'] as $value) {
-                $apiConfig[] = $value;
-            }
-        }
-        $this->_errorCode = require_once \Yii::getAlias('@common/helpers/ocr/baidu/') . 'errorCode.php';
-        // 创建ocr识别接口对象
-        $this->_ocrApiObj = \Yii::createObject($this->_typeClass, $apiConfig);
-    }
-
-    /**
-     * 身份证识别
-     * @param $image
-     * @param array $params
-     * [
-     *      'idCardSide' => 'front' | 'back',
-     *      'options' => [
-     *          'detect_direction' => false,
-     *          'detect_risk' => false,
-     *      ],
-     * ]
-     * @return null | array
-     */
-    public function idCard($image, array $params = []) {
-        $result = null;
-        $image = file_get_contents($image);
-        if ($this->_type === self::TYPE_BAIDU) {
-            $default = [
-                'idCardSide' => 'front',
-                'options' => [
-                    'detect_direction' => false,
-                    'detect_risk' => false,
-                ],
-            ];
-            $argv = Tool::deepParse($params, $default);
-            $tempResult = $this->_ocrApiObj->idcard($image, $argv['idCardSide'], $argv['options']);
-            $errorCode = $this->_errorCode;
-            if (isset($tempResult['error_code'])) {
-                $result = [
-                    'success' => false,
-                    'message' => $errorCode[$tempResult['error_code']]['zh'] ?? '未知错误',
-                ];
-            } else {
-                $message = '';
-                switch ($tempResult['image_status']) {
-                    case 'normal':
-                        $message = '识别正常';
-                        break;
-                    case 'reversed_side':
-                        $message = '未摆正身份证';
-                        break;
-                    case 'non_idcard':
-                        $message = '上传的图片中不包含身份证';
-                        break;
-                    case 'blurred':
-                        $message = '身份证模糊';
-                        break;
-                    case 'over_exposure':
-                        $message = '身份证关键字段反光或过曝';
-                        break;
-                    case 'unknown':
-                        $message = '未知错误';
-                        break;
-                    default :
-                        $message = '未知错误';
-                        break;
-                }
-                $result = [
-                    'success' => $tempResult['image_status'] == 'normal' ? true : false,
-                    'message' => $message,
-                    'address' => $tempResult['words_result']['住址']['words'] ?? null,
-                    'idCardNo' => $tempResult['words_result']['公民身份号码']['words'] ?? null,
-                    'birthDay' => $tempResult['words_result']['出生']['words'] ?? null,
-                    'realName' => $tempResult['words_result']['姓名']['words'] ?? null,
-                    'sex' => $tempResult['words_result']['性别']['words'] ?? null,
-                    'nation' => $tempResult['words_result']['民族']['words'] ?? null,
-                ];
-            }
-        }
-        return $result;
-    }
-
-    /**
-     * 增值税发票识别
-     * @param $image
-     * @param array $params
-     * [
-     *      'options' => [
-     *          'accuracy' => normal,
-     *      ],
-     * ]
-     * @return array|null
-     */
-    public function vatInvoice($image, array $params = []) {
-        $result = null;
-        $image = file_get_contents($image);
-        if ($this->_type === self::TYPE_BAIDU) {
-            $default = [
-                'options' => [
-                    'accuracy' => 'normal',
-                ],
-            ];
-            $argv = Tool::deepParse($params, $default);
-            $tempResult = $this->_ocrApiObj->vatInvoice($image, $argv['options']);
-            $errorCode = $errorCode = $this->_errorCode;;
-            if (isset($tempResult['error_code'])) {
-                $result = [
-                    'success' => false,
-                    'message' => $errorCode[$tempResult['error_code']]['zh'] ?? '未知错误',
-                ];
-            } else {
-                $result = [
-                    'success' => true,
-                    'message' => '识别正常',
-                    'invoiceCode' => $tempResult['words_result']['InvoiceCode'] ?? null,
-                    'invoiceNum' => $tempResult['words_result']['InvoiceNum'] ?? null,
-                    'invoiceDate' => $tempResult['words_result']['InvoiceDate'] ?? null,
-                    'amount' => $tempResult['words_result']['AmountInFiguers'] ?? null,
-                    'taxRate' => $tempResult['words_result']['CommodityTaxRate'][0]['word'] ?? null,
-                    'purchaserName' => $tempResult['words_result']['PurchaserName'] ?? null,
-                    'purchaserRegisterNum' => $tempResult['words_result']['PurchaserRegisterNum'] ?? null,
-                    'purchaserAddress' => $tempResult['words_result']['PurchaserAddress'] ?? null,
-                    'purchaserBank' => $tempResult['words_result']['PurchaserBank'] ?? null,
-                    'sellerName' => $tempResult['words_result']['SellerName'] ?? null,
-                    'sellerRegisterNum' => $tempResult['words_result']['SellerRegisterNum'] ?? null,
-                    'sellerAddress' => $tempResult['words_result']['SellerAddress'] ?? null,
-                    'sellerBank' => $tempResult['words_result']['SellerBank'] ?? null,
-                    'itemName' => $tempResult['words_result']['CommodityName'][0]['word'] ?? null,
-                    'invoiceRemark' => $tempResult['words_result']['Remarks'] ?? null,
-                ];
-                //$result = array_merge($result, $tempResult);
-            }
-        }
-        return $result;
-    }
-
-    /**
-     * 获取api设置的字段
-     * @param $apiName
-     * @return array
-     */
-    public static function apiConfigs($apiName) {
-        $allApiModelData = \common\models\OcrApi::getAllData();
-        $result = [];
-        if ($apiName == self::TYPE_BAIDU) {
-            $result = [
-                'appId' => ['TITLE' => 'AppId', 'CONFIG_NAME' => 'appId', 'INPUT_TYPE' => 1, 'OPTIONS' => null, 'VALUE' => $allApiModelData[self::TYPE_BAIDU]['CONFIG']['appId'] ?? null],
-                'apiKey' => ['TITLE' => 'ApiKey', 'CONFIG_NAME' => 'apiKey', 'INPUT_TYPE' => 1, 'OPTIONS' => null, 'VALUE' => $allApiModelData[self::TYPE_BAIDU]['CONFIG']['apiKey'] ?? null],
-                'secretKey' => ['TITLE' => 'SecretKey', 'CONFIG_NAME' => 'secretKey', 'INPUT_TYPE' => 1, 'OPTIONS' => null, 'VALUE' => $allApiModelData[self::TYPE_BAIDU]['CONFIG']['secretKey'] ?? null],
-            ];
-        }
-        return $result;
-    }
-}

+ 0 - 783
common/helpers/ocr/baidu/AipOcr.php

@@ -1,783 +0,0 @@
-<?php
-/*
-* Copyright (c) 2017 Baidu.com, Inc. All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License"); you may not
-* use this file except in compliance with the License. You may obtain a copy of
-* the License at
-*
-* Http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-* License for the specific language governing permissions and limitations under
-* the License.
-*/
-namespace common\helpers\ocr\baidu;
-
-use common\helpers\ocr\baidu\lib\AipBase;
-
-class AipOcr extends AipBase {
-
-    /**
-     * 通用文字识别 general_basic api url
-     * @var string
-     */
-    private $generalBasicUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/general_basic';
-
-    /**
-     * 通用文字识别(高精度版) accurate_basic api url
-     * @var string
-     */
-    private $accurateBasicUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/accurate_basic';
-
-    /**
-     * 通用文字识别(含位置信息版) general api url
-     * @var string
-     */
-    private $generalUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/general';
-
-    /**
-     * 通用文字识别(含位置高精度版) accurate api url
-     * @var string
-     */
-    private $accurateUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/accurate';
-
-    /**
-     * 通用文字识别(含生僻字版) general_enhanced api url
-     * @var string
-     */
-    private $generalEnhancedUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/general_enhanced';
-
-    /**
-     * 网络图片文字识别 web_image api url
-     * @var string
-     */
-    private $webImageUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/webimage';
-
-    /**
-     * 身份证识别 idcard api url
-     * @var string
-     */
-    private $idcardUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/idcard';
-
-    /**
-     * 银行卡识别 bankcard api url
-     * @var string
-     */
-    private $bankcardUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/bankcard';
-
-    /**
-     * 驾驶证识别 driving_license api url
-     * @var string
-     */
-    private $drivingLicenseUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/driving_license';
-
-    /**
-     * 行驶证识别 vehicle_license api url
-     * @var string
-     */
-    private $vehicleLicenseUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/vehicle_license';
-
-    /**
-     * 车牌识别 license_plate api url
-     * @var string
-     */
-    private $licensePlateUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/license_plate';
-
-    /**
-     * 营业执照识别 business_license api url
-     * @var string
-     */
-    private $businessLicenseUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/business_license';
-
-    /**
-     * 通用票据识别 receipt api url
-     * @var string
-     */
-    private $receiptUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/receipt';
-
-    /**
-     * 表格文字识别同步接口 form api url
-     * @var string
-     */
-    private $formUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/form';
-
-    /**
-     * 表格文字识别 table_recognize api url
-     * @var string
-     */
-    private $tableRecognizeUrl = 'https://aip.baidubce.com/rest/2.0/solution/v1/form_ocr/request';
-
-    /**
-     * 表格识别结果 table_result_get api url
-     * @var string
-     */
-    private $tableResultGetUrl = 'https://aip.baidubce.com/rest/2.0/solution/v1/form_ocr/get_request_result';
-
-    /**
-     * 增值税发票识别 vat_invoice api url
-     * @var string
-     */
-    private $vatInvoiceUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/vat_invoice';
-
-    /**
-     * 二维码识别 qrcode api url
-     * @var string
-     */
-    private $qrcodeUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/qrcode';
-
-    /**
-     * 数字识别 numbers api url
-     * @var string
-     */
-    private $numbersUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/numbers';
-
-    /**
-     * 彩票识别 lottery api url
-     * @var string
-     */
-    private $lotteryUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/lottery';
-
-    /**
-     * 护照识别 passport api url
-     * @var string
-     */
-    private $passportUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/passport';
-
-    /**
-     * 名片识别 business_card api url
-     * @var string
-     */
-    private $businessCardUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/business_card';
-
-    /**
-     * 手写文字识别 handwriting api url
-     * @var string
-     */
-    private $handwritingUrl = 'https://aip.baidubce.com/rest/2.0/ocr/v1/handwriting';
-
-    /**
-     * 自定义模板文字识别 custom api url
-     * @var string
-     */
-    private $customUrl = 'https://aip.baidubce.com/rest/2.0/solution/v1/iocr/recognise';
-
-    
-
-    /**
-     * 通用文字识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   language_type 识别语言类型,默认为CHN_ENG。可选值包括:<br>- CHN_ENG:中英文混合;<br>- ENG:英文;<br>- POR:葡萄牙语;<br>- FRE:法语;<br>- GER:德语;<br>- ITA:意大利语;<br>- SPA:西班牙语;<br>- RUS:俄语;<br>- JAP:日语;<br>- KOR:韩语;
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     *   detect_language 是否检测语言,默认不检测。当前支持(中文、英语、日语、韩语)
-     *   probability 是否返回识别结果中每一行的置信度
-     * @return array
-     */
-    public function basicGeneral($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->generalBasicUrl, $data);
-    }
-
-    /**
-     * 通用文字识别接口
-     *
-     * @param string $url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   language_type 识别语言类型,默认为CHN_ENG。可选值包括:<br>- CHN_ENG:中英文混合;<br>- ENG:英文;<br>- POR:葡萄牙语;<br>- FRE:法语;<br>- GER:德语;<br>- ITA:意大利语;<br>- SPA:西班牙语;<br>- RUS:俄语;<br>- JAP:日语;<br>- KOR:韩语;
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     *   detect_language 是否检测语言,默认不检测。当前支持(中文、英语、日语、韩语)
-     *   probability 是否返回识别结果中每一行的置信度
-     * @return array
-     */
-    public function basicGeneralUrl($url, $options=array()){
-
-        $data = array();
-        
-        $data['url'] = $url;
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->generalBasicUrl, $data);
-    }
-
-    /**
-     * 通用文字识别(高精度版)接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     *   probability 是否返回识别结果中每一行的置信度
-     * @return array
-     */
-    public function basicAccurate($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->accurateBasicUrl, $data);
-    }
-
-    /**
-     * 通用文字识别(含位置信息版)接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   recognize_granularity 是否定位单字符位置,big:不定位单字符位置,默认值;small:定位单字符位置
-     *   language_type 识别语言类型,默认为CHN_ENG。可选值包括:<br>- CHN_ENG:中英文混合;<br>- ENG:英文;<br>- POR:葡萄牙语;<br>- FRE:法语;<br>- GER:德语;<br>- ITA:意大利语;<br>- SPA:西班牙语;<br>- RUS:俄语;<br>- JAP:日语;<br>- KOR:韩语;
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     *   detect_language 是否检测语言,默认不检测。当前支持(中文、英语、日语、韩语)
-     *   vertexes_location 是否返回文字外接多边形顶点位置,不支持单字位置。默认为false
-     *   probability 是否返回识别结果中每一行的置信度
-     * @return array
-     */
-    public function general($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->generalUrl, $data);
-    }
-
-    /**
-     * 通用文字识别(含位置信息版)接口
-     *
-     * @param string $url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   recognize_granularity 是否定位单字符位置,big:不定位单字符位置,默认值;small:定位单字符位置
-     *   language_type 识别语言类型,默认为CHN_ENG。可选值包括:<br>- CHN_ENG:中英文混合;<br>- ENG:英文;<br>- POR:葡萄牙语;<br>- FRE:法语;<br>- GER:德语;<br>- ITA:意大利语;<br>- SPA:西班牙语;<br>- RUS:俄语;<br>- JAP:日语;<br>- KOR:韩语;
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     *   detect_language 是否检测语言,默认不检测。当前支持(中文、英语、日语、韩语)
-     *   vertexes_location 是否返回文字外接多边形顶点位置,不支持单字位置。默认为false
-     *   probability 是否返回识别结果中每一行的置信度
-     * @return array
-     */
-    public function generalUrl($url, $options=array()){
-
-        $data = array();
-        
-        $data['url'] = $url;
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->generalUrl, $data);
-    }
-
-    /**
-     * 通用文字识别(含位置高精度版)接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   recognize_granularity 是否定位单字符位置,big:不定位单字符位置,默认值;small:定位单字符位置
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     *   vertexes_location 是否返回文字外接多边形顶点位置,不支持单字位置。默认为false
-     *   probability 是否返回识别结果中每一行的置信度
-     * @return array
-     */
-    public function accurate($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->accurateUrl, $data);
-    }
-
-    /**
-     * 通用文字识别(含生僻字版)接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   language_type 识别语言类型,默认为CHN_ENG。可选值包括:<br>- CHN_ENG:中英文混合;<br>- ENG:英文;<br>- POR:葡萄牙语;<br>- FRE:法语;<br>- GER:德语;<br>- ITA:意大利语;<br>- SPA:西班牙语;<br>- RUS:俄语;<br>- JAP:日语;<br>- KOR:韩语;
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     *   detect_language 是否检测语言,默认不检测。当前支持(中文、英语、日语、韩语)
-     *   probability 是否返回识别结果中每一行的置信度
-     * @return array
-     */
-    public function enhancedGeneral($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->generalEnhancedUrl, $data);
-    }
-
-    /**
-     * 通用文字识别(含生僻字版)接口
-     *
-     * @param string $url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   language_type 识别语言类型,默认为CHN_ENG。可选值包括:<br>- CHN_ENG:中英文混合;<br>- ENG:英文;<br>- POR:葡萄牙语;<br>- FRE:法语;<br>- GER:德语;<br>- ITA:意大利语;<br>- SPA:西班牙语;<br>- RUS:俄语;<br>- JAP:日语;<br>- KOR:韩语;
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     *   detect_language 是否检测语言,默认不检测。当前支持(中文、英语、日语、韩语)
-     *   probability 是否返回识别结果中每一行的置信度
-     * @return array
-     */
-    public function enhancedGeneralUrl($url, $options=array()){
-
-        $data = array();
-        
-        $data['url'] = $url;
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->generalEnhancedUrl, $data);
-    }
-
-    /**
-     * 网络图片文字识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     *   detect_language 是否检测语言,默认不检测。当前支持(中文、英语、日语、韩语)
-     * @return array
-     */
-    public function webImage($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->webImageUrl, $data);
-    }
-
-    /**
-     * 网络图片文字识别接口
-     *
-     * @param string $url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     *   detect_language 是否检测语言,默认不检测。当前支持(中文、英语、日语、韩语)
-     * @return array
-     */
-    public function webImageUrl($url, $options=array()){
-
-        $data = array();
-        
-        $data['url'] = $url;
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->webImageUrl, $data);
-    }
-
-    /**
-     * 身份证识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param string $idCardSide - front:身份证含照片的一面;back:身份证带国徽的一面
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     *   detect_risk 是否开启身份证风险类型(身份证复印件、临时身份证、身份证翻拍、修改过的身份证)功能,默认不开启,即:false。可选值:true-开启;false-不开启
-     * @return array
-     */
-    public function idcard($image, $idCardSide, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-        $data['id_card_side'] = $idCardSide;
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->idcardUrl, $data);
-    }
-
-    /**
-     * 银行卡识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     * @return array
-     */
-    public function bankcard($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->bankcardUrl, $data);
-    }
-
-    /**
-     * 驾驶证识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     * @return array
-     */
-    public function drivingLicense($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->drivingLicenseUrl, $data);
-    }
-
-    /**
-     * 行驶证识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     *   accuracy normal 使用快速服务,1200ms左右时延;缺省或其它值使用高精度服务,1600ms左右时延
-     * @return array
-     */
-    public function vehicleLicense($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->vehicleLicenseUrl, $data);
-    }
-
-    /**
-     * 车牌识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   multi_detect 是否检测多张车牌,默认为false,当置为true的时候可以对一张图片内的多张车牌进行识别
-     * @return array
-     */
-    public function licensePlate($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->licensePlateUrl, $data);
-    }
-
-    /**
-     * 营业执照识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     * @return array
-     */
-    public function businessLicense($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->businessLicenseUrl, $data);
-    }
-
-    /**
-     * 通用票据识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   recognize_granularity 是否定位单字符位置,big:不定位单字符位置,默认值;small:定位单字符位置
-     *   probability 是否返回识别结果中每一行的置信度
-     *   accuracy normal 使用快速服务,1200ms左右时延;缺省或其它值使用高精度服务,1600ms左右时延
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     * @return array
-     */
-    public function receipt($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->receiptUrl, $data);
-    }
-
-    /**
-     * 表格文字识别同步接口接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     * @return array
-     */
-    public function form($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->formUrl, $data);
-    }
-
-    /**
-     * 表格文字识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     * @return array
-     */
-    public function tableRecognitionAsync($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->tableRecognizeUrl, $data);
-    }
-
-    /**
-     * 表格识别结果接口
-     *
-     * @param string $requestId - 发送表格文字识别请求时返回的request id
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   result_type 期望获取结果的类型,取值为“excel”时返回xls文件的地址,取值为“json”时返回json格式的字符串,默认为”excel”
-     * @return array
-     */
-    public function getTableRecognitionResult($requestId, $options=array()){
-
-        $data = array();
-        
-        $data['request_id'] = $requestId;
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->tableResultGetUrl, $data);
-    }
-
-    /**
-     * 增值税发票识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     * @return array
-     */
-    public function vatInvoice($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->vatInvoiceUrl, $data);
-    }
-
-    /**
-     * 二维码识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     * @return array
-     */
-    public function qrcode($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->qrcodeUrl, $data);
-    }
-
-    /**
-     * 数字识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   recognize_granularity 是否定位单字符位置,big:不定位单字符位置,默认值;small:定位单字符位置
-     *   detect_direction 是否检测图像朝向,默认不检测,即:false。朝向是指输入图像是正常方向、逆时针旋转90/180/270度。可选值包括:<br>- true:检测朝向;<br>- false:不检测朝向。
-     * @return array
-     */
-    public function numbers($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->numbersUrl, $data);
-    }
-
-    /**
-     * 彩票识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   recognize_granularity 是否定位单字符位置,big:不定位单字符位置,默认值;small:定位单字符位置
-     * @return array
-     */
-    public function lottery($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->lotteryUrl, $data);
-    }
-
-    /**
-     * 护照识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     * @return array
-     */
-    public function passport($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->passportUrl, $data);
-    }
-
-    /**
-     * 名片识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     * @return array
-     */
-    public function businessCard($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->businessCardUrl, $data);
-    }
-
-    /**
-     * 手写文字识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     *   recognize_granularity 是否定位单字符位置,big:不定位单字符位置,默认值;small:定位单字符位置
-     * @return array
-     */
-    public function handwriting($image, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->handwritingUrl, $data);
-    }
-
-    /**
-     * 自定义模板文字识别接口
-     *
-     * @param string $image - 图像数据,base64编码,要求base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式
-     * @param string $templateSign - 您在自定义文字识别平台制作的模板的ID
-     * @param array $options - 可选参数对象,key: value都为string类型
-     * @description options列表:
-     * @return array
-     */
-    public function custom($image, $templateSign, $options=array()){
-
-        $data = array();
-        
-        $data['image'] = base64_encode($image);
-        $data['templateSign'] = $templateSign;
-
-        $data = array_merge($data, $options);
-
-        return $this->request($this->customUrl, $data);
-    }
-
-    /**
-     * 同步请求
-     * @param  string $image 图像读取
-     * @param  options 接口可选参数
-     * @return array
-     */
-    public function tableRecognition($image, $options=array(), $timeout=10000){
-        $result = $this->tableRecognitionAsync($image);
-        if(isset($result['error_code'])){
-            return $result;
-        }
-        $requestId = $result['result'][0]['request_id'];
-        $count = ceil($timeout / 1000);
-        for($i=0; $i<$count; $i++){
-            $result = $this->getTableRecognitionResult($requestId, $options);
-            // 完成
-            if($result['result']['ret_code'] == 3){ 
-                break;
-            }
-            sleep(1);
-        }
-        return $result;
-    }
-
-}
-

+ 0 - 50
common/helpers/ocr/baidu/errorCode.php

@@ -1,50 +0,0 @@
-<?php
-/**
- * Created by PhpStorm.
- * User: leo
- * Date: 2018/5/22
- * Time: 下午5:34
- */
-return [
-    '1' => ['en' => 'Unknown error', 'zh' => '服务器内部错误,请再次请求, 如果持续出现此类错误,请在控制台提交工单联系技术支持团队'],
-    '2' => ['en' => 'Service temporarily unavailable', 'zh' => '服务暂不可用,请再次请求, 如果持续出现此类错误,请在控制台提交工单联系技术支持团队'],
-    '3' => ['en' => 'Unsupported openapi method', 'zh' => '调用的API不存在,请检查后重新尝试'],
-    '4' => ['en' => 'Open api request limit reached', 'zh' => '集群超限额'],
-    '6' => ['en' => 'No permission to access data', 'zh' => '无权限访问该用户数据'],
-    '14' => ['en' => 'IAM Certification failed', 'zh' => 'IAM鉴权失败,建议用户参照文档自查生成sign的方式是否正确,或换用控制台中ak sk的方式调用'],
-    '17' => ['en' => 'Open api daily request limit reached', 'zh' => '每天请求量超限额'],
-    '18' => ['en' => 'Open api qps request limit reached', 'zh' => 'QPS超限额'],
-    '19' => ['en' => 'Open api total request limit reached', 'zh' => '请求总量超限额'],
-    '100' => ['en' => 'Invalid parameter', 'zh' => '无效的access_token参数,请检查后重新尝试'],
-    '110' => ['en' => 'Access token invalid or no longer valid', 'zh' => 'access_token无效'],
-    '111' => ['en' => 'Access token expired', 'zh' => 'access token过期'],
-    '282000' => ['en' => 'internal error', 'zh' => '服务器内部错误,如果您使用的是高精度接口,报这个错误码的原因可能是您上传的图片中文字过多,识别超时导致的,建议您对图片进行切割后再识别,其他情况请再次请求, 如果持续出现此类错误,请在控制台提交工单联系技术支持团队'],
-    '216100' => ['en' => 'invalid param', 'zh' => '请求中包含非法参数,请检查后重新尝试'],
-    '216101' => ['en' => 'not enough param', 'zh' => '缺少必须的参数,请检查参数是否有遗漏'],
-    '216102' => ['en' => 'service not support', 'zh' => '请求了不支持的服务,请检查调用的url'],
-    '216103' => ['en' => 'param too long', 'zh' => '请求中某些参数过长,请检查后重新尝试'],
-    '216110' => ['en' => 'appid not exist', 'zh' => 'appid不存在,请重新核对信息是否为后台应用列表中的appid'],
-    '216200' => ['en' => 'empty image', 'zh' => '图片为空,请检查后重新尝试'],
-    '216201' => ['en' => 'image format error', 'zh' => '上传的图片格式错误,现阶段我们支持的图片格式为:PNG、JPG、JPEG、BMP,请进行转码或更换图片'],
-    '216202' => ['en' => 'image size error', 'zh' => '上传的图片大小错误,现阶段我们支持的图片大小为:base64编码后小于4M,分辨率不高于4096*4096,请重新上传图片'],
-    '216630' => ['en' => 'recognize error', 'zh' => '识别错误,请再次请求,如果持续出现此类错误,请在控制台提交工单联系技术支持团队'],
-    '216631' => ['en' => 'recognize bank card error', 'zh' => '识别银行卡错误,出现此问题的原因一般为:您上传的图片非银行卡正面,上传了异形卡的图片或上传的银行卡正品图片不完整'],
-    '216633' => ['en' => 'recognize idcard error', 'zh' => '识别身份证错误,出现此问题的原因一般为:您上传了非身份证图片或您上传的身份证图片不完整'],
-    '216634' => ['en' => 'detect error', 'zh' => '检测错误,请再次请求,如果持续出现此类错误,请在控制台提交工单联系技术支持团队'],
-    '272000' => ['en' => 'structure failed', 'zh' => '未能匹配模板,请检查参照字段的设置是否符合规范,并重新选取或增加更多的参照字段'],
-    '272001' => ['en' => 'classify failed', 'zh' => '未能成功分类	一般是因为上传的图片不属于任一训练过的图片种类,请核查上传的图片,或对分类的训练集作出调整'],
-    '282003' => ['en' => 'missing parameters: {参数名}', 'zh' => '请求参数缺失'],
-    '282004' => ['en' => "invalid parameter, appId doesn't own this template nor not launch", 'zh' => '您指定的模板暂未发布,请先保存发布该模板,再调用'],
-    '282005' => ['en' => 'batch processing error', 'zh' => '处理批量任务时发生部分或全部错误,请根据具体错误码排查'],
-    '282006' => ['en' => 'batch task limit reached', 'zh' => '批量任务处理数量超出限制,请将任务数量减少到10或10以下'],
-    '282102' => ['en' => 'target detect error', 'zh' => '未检测到图片中识别目标,请确保图片中包含对应卡证票据'],
-    '282103' => ['en' => 'target recognize error', 'zh' => '图片目标识别错误,请确保图片中包含对应卡证票据,如果持续出现此类错误,请在控制台提交工单联系技术支持团队'],
-    '282110' => ['en' => 'urls not exit', 'zh' => 'URL参数不存在,请核对URL后再次提交'],
-    '282111' => ['en' => 'url format illegal', 'zh' => 'URL格式非法,请检查url格式是否符合相应接口的入参要求'],
-    '282112' => ['en' => 'url download timeout', 'zh' => 'url下载超时,请检查url对应的图床/图片无法下载或链路状况不好,您可以重新尝试一下,如果多次尝试后仍不行,建议更换图片地址'],
-    '282113' => ['en' => 'url response invalid', 'zh' => 'URL返回无效参数'],
-    '282114' => ['en' => 'url size error', 'zh' => 'URL长度超过1024字节或为0'],
-    '282808' => ['en' => 'request id: xxxxx not exist', 'zh' => 'request id xxxxx 不存在'],
-    '282809' => ['en' => 'result type error', 'zh' => '返回结果请求错误(不属于excel或json)'],
-    '282810' => ['en' => 'image recognize error', 'zh' => '图像识别错误'],
-];

+ 0 - 405
common/helpers/ocr/baidu/lib/AipBase.php

@@ -1,405 +0,0 @@
-<?php
-/*
-* Copyright (c) 2017 Baidu.com, Inc. All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License"); you may not
-* use this file except in compliance with the License. You may obtain a copy of
-* the License at
-*
-* Http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-* License for the specific language governing permissions and limitations under
-* the License.
-*/
-namespace common\helpers\ocr\baidu\lib;
-
-/**
- * Aip Base 基类
- */
-class AipBase {
-
-    /**
-     * 获取access token url
-     * @var string
-     */
-    protected $accessTokenUrl = 'https://aip.baidubce.com/oauth/2.0/token';
-
-     /**
-     * 反馈接口
-     * @var string
-     */
-    protected $reportUrl = 'https://aip.baidubce.com/rpc/2.0/feedback/v1/report';
-
-    /**
-     * appId
-     * @var string
-     */
-    protected $appId = '';
-
-    /**
-     * apiKey
-     * @var string
-     */
-    protected $apiKey = '';
-    
-    /**
-     * secretKey
-     * @var string
-     */
-    protected $secretKey = '';
-
-    /**
-     * 权限
-     * @var array
-     */
-    protected $scope = 'brain_all_scope';
-
-    protected $isCloudUser;
-    protected $client;
-    protected $version;
-    protected $proxies;
-
-    protected $authFileDirPath;
-
-    /**
-     * @param string $appId 
-     * @param string $apiKey
-     * @param string $secretKey
-     */
-    public function __construct($appId, $apiKey, $secretKey){
-        AipHttpUtil::__init();
-        AipSampleSigner::__init();
-        $this->appId = trim($appId);
-        $this->apiKey = trim($apiKey);
-        $this->secretKey = trim($secretKey);
-        $this->isCloudUser = null;
-        $this->client = new AipHttpClient();
-        $this->version = '2_2_3';
-        $this->proxies = array();
-        $this->authFileDirPath = \Yii::getAlias('@common/runtime/baiduOcr/');
-    }
-
-    /**
-     * 查看版本
-     * @return string
-     * 
-     */
-    public function getVersion(){
-        return $this->version;
-    }    
-
-    /**
-     * 连接超时
-     * @param int $ms 毫秒
-     */
-    public function setConnectionTimeoutInMillis($ms){
-        $this->client->setConnectionTimeoutInMillis($ms);
-    }
-
-    /**
-     * 响应超时
-     * @param int $ms 毫秒
-     */
-    public function setSocketTimeoutInMillis($ms){
-        $this->client->setSocketTimeoutInMillis($ms);
-    }
-
-    /**
-     * 代理
-     * @param $proxies
-     */
-    public function setProxies($proxies){
-        $this->client->setConf($proxies);
-    } 
-
-    /**
-     * 处理请求参数
-     * @param  string $url
-     * @param array $params
-     * @param array $data
-     * @param array $headers
-     */
-    protected function proccessRequest($url, &$params, &$data, $headers){
-        $params['aipSdk'] = 'php';
-        $params['aipSdkVersion'] = $this->version;
-    }
-
-    /**
-     * Api 请求
-     * @param $url
-     * @param $data
-     * @param array $headers
-     * @return array|mix|mixed
-     * @throws \Exception
-     */
-    protected function request($url, $data, $headers=array()){
-        try{
-            $result = $this->validate($url, $data);
-            if($result !== true){
-                return $result;
-            }
-
-            $params = array();
-            $authObj = $this->auth();
-
-            if($this->isCloudUser === false){
-                $params['access_token'] = $authObj['access_token'];
-            }
-
-            // 特殊处理
-            $this->proccessRequest($url, $params, $data, $headers);
- 
-            $headers = $this->getAuthHeaders('POST', $url, $params, $headers);
-            $response = $this->client->post($url, $data, $params, $headers);
- 
-            $obj = $this->proccessResult($response['content']);
-
-            if(!$this->isCloudUser && isset($obj['error_code']) && $obj['error_code'] == 110){
-                $authObj = $this->auth(true);
-                $params['access_token'] = $authObj['access_token'];
-                $response = $this->client->post($url, $data, $params, $headers);
-                $obj = $this->proccessResult($response['content']);
-            }
-
-            if(empty($obj) || !isset($obj['error_code'])){
-                $this->writeAuthObj($authObj);
-            }
-        }catch(\Exception $e){
-            return array(
-                'error_code' => 'SDK108',
-                'error_msg' => 'connection or read data timeout',
-            );
-        }
-
-        return $obj;
-    }
-
-    /**
-     * Api 多个并发请求
-     * @param $url
-     * @param $data
-     * @return array
-     * @throws \Exception
-     */
-    protected function multi_request($url, $data){
-        try{
-            $params = array();
-            $authObj = $this->auth();
-            $headers = $this->getAuthHeaders('POST', $url);
-
-            if($this->isCloudUser === false){
-                $params['access_token'] = $authObj['access_token'];
-            }
-
-            $responses = $this->client->multi_post($url, $data, $params, $headers);
-
-            $is_success = false;
-            foreach($responses as $response){
-                $obj = $this->proccessResult($response['content']);
-
-                if(empty($obj) || !isset($obj['error_code'])){
-                    $is_success = true;
-                }
-
-                if(!$this->isCloudUser && isset($obj['error_code']) && $obj['error_code'] == 110){
-                    $authObj = $this->auth(true);
-                    $params['access_token'] = $authObj['access_token'];
-                    $responses = $this->client->post($url, $data, $params, $headers);
-                    break;
-                }
-            }
-
-            if($is_success){
-                $this->writeAuthObj($authObj);
-            }
-
-            $objs = array();
-            foreach($responses as $response){
-                $objs[] = $this->proccessResult($response['content']);
-            }
-
-        }catch(\Exception $e){
-            return array(
-                'error_code' => 'SDK108',
-                'error_msg' => 'connection or read data timeout',
-            );
-        }
-
-        return $objs;
-    }
-
-    /**
-     * 格式检查
-     * @param $url
-     * @param $data
-     * @return bool
-     */
-    protected function validate($url, &$data){
-        return true;
-    }
-
-    /**
-     * 格式化结果
-     * @param $content string
-     * @return mixed
-     */
-    protected function proccessResult($content){
-        return json_decode($content, true);
-    }
-
-    /**
-     * 返回 access token 路径
-     * @return string
-     */
-    private function getAuthFilePath(){
-        return $this->authFileDirPath . DIRECTORY_SEPARATOR . md5($this->apiKey);
-    }
-
-    /**
-     * 写入本地文件
-     * @param  array $obj
-     * @return void
-     */
-    private function writeAuthObj($obj){
-        if($obj === null || (isset($obj['is_read']) && $obj['is_read'] === true)){
-            return;
-        }
-
-        $obj['time'] = time();
-        $obj['is_cloud_user'] = $this->isCloudUser;
-        @file_put_contents($this->getAuthFilePath(), json_encode($obj));
-    }
-
-    /**
-     * 读取本地缓存
-     * @return array
-     */
-    private function readAuthObj(){
-        $content = @file_get_contents($this->getAuthFilePath());
-        if($content !== false){
-            $obj = json_decode($content, true);
-            $this->isCloudUser = $obj['is_cloud_user'];
-            $obj['is_read'] = true;
-            if($this->isCloudUser || $obj['time'] + $obj['expires_in'] - 30 > time()){
-                return $obj;
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * 认证
-     * @param bool $refresh 是否刷新
-     * @return array
-     */
-    private function auth($refresh=false){
-
-        //非过期刷新
-        if(!$refresh){
-            $obj = $this->readAuthObj();
-            if(!empty($obj)){
-                return $obj;
-            }
-        }
-
-        $response = $this->client->get($this->accessTokenUrl, array(
-            'grant_type' => 'client_credentials',
-            'client_id' => $this->apiKey,
-            'client_secret' => $this->secretKey,
-        ));
-        
-        $obj = json_decode($response['content'], true);
-
-        $this->isCloudUser = !$this->isPermission($obj);
-        return $obj;
-    }
-
-    /**
-     * 判断认证是否有权限
-     * @param  array   $authObj 
-     * @return boolean          
-     */
-    protected function isPermission($authObj)
-    {
-        if(empty($authObj) || !isset($authObj['scope'])){
-            return false;
-        }
-
-        $scopes = explode(' ', $authObj['scope']);
-
-        return in_array($this->scope, $scopes);
-    }
-
-    /**
-     * @param  string $method HTTP method
-     * @param  string $url
-     * @param  array $params 参数
-     * @param  array $headers
-     * @return array
-     */
-    private function getAuthHeaders($method, $url, $params=array(), $headers=array()){
-        
-        //不是云的老用户则不用在header中签名 认证
-        if($this->isCloudUser === false){
-            return $headers;
-        }
-
-        $obj = parse_url($url);
-        if(!empty($obj['query'])){        
-            foreach(explode('&', $obj['query']) as $kv){
-                if(!empty($kv)){
-                    list($k, $v) = explode('=', $kv, 2);
-                    $params[$k] = $v;
-                }
-            }
-        }
-
-        //UTC 时间戳
-        $timestamp = gmdate('Y-m-d\TH:i:s\Z');
-        $headers['Host'] = isset($obj['port']) ? sprintf('%s:%s', $obj['host'], $obj['port']) : $obj['host'];
-        $headers['x-bce-date'] = $timestamp;
-
-        //签名
-        $headers['authorization'] = AipSampleSigner::sign(array(
-            'ak' => $this->apiKey,
-            'sk' => $this->secretKey,
-        ), $method, $obj['path'], $headers, $params, array(
-            'timestamp' => $timestamp,
-            'headersToSign' => array_keys($headers),
-        ));
-
-        return $headers;
-    }
-
-    /**
-     * 反馈
-     * @param $feedback
-     * @return array|mix|mixed
-     * @throws \Exception
-     */
-    public function report($feedback){
-
-        $data = array();
-        
-        $data['feedback'] = $feedback;
-
-        return $this->request($this->reportUrl, $data);
-    }
-
-    /**
-     * 通用接口
-     * @param $url
-     * @param $data
-     * @param array $headers
-     * @return array|mix|mixed
-     * @throws \Exception
-     */
-    public function post($url, $data, $headers=array()){
-        return $this->request($url, $data, $headers);
-    }
-
-}

+ 0 - 222
common/helpers/ocr/baidu/lib/AipHttpClient.php

@@ -1,222 +0,0 @@
-<?php
-/*
-* Copyright (c) 2017 Baidu.com, Inc. All Rights Reserved
-*
-* Licensed under the Apache License, Version 2.0 (the "License"); you may not
-* use this file except in compliance with the License. You may obtain a copy of
-* the License at
-*
-* Http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-* License for the specific language governing permissions and limitations under
-* the License.
-*/
-namespace common\helpers\ocr\baidu\lib;
-
-/**
- * Http Client
- */
-class AipHttpClient{
-
-    protected $headers;
-    protected $connectTimeout;
-    protected $socketTimeout;
-    protected $conf;
-
-    /**
-     * HttpClient
-     * @param array $headers HTTP header
-     */
-    public function __construct($headers=array()){
-        $this->headers = $this->buildHeaders($headers);
-        $this->connectTimeout = 60000;
-        $this->socketTimeout = 60000;
-        $this->conf = array();
-    }
-
-    /**
-     * 连接超时
-     * @param int $ms 毫秒
-     */
-    public function setConnectionTimeoutInMillis($ms){
-        $this->connectTimeout = $ms;
-    }
-
-    /**
-     * 响应超时
-     * @param int $ms 毫秒
-     */
-    public function setSocketTimeoutInMillis($ms){
-        $this->socketTimeout = $ms;
-    }    
-
-    /**
-     * 配置
-     * @param array $conf
-     */
-    public function setConf($conf){
-        $this->conf = $conf;
-    }
-
-    /**
-     * 请求预处理
-     * @param resource $ch
-     */
-    public function prepare($ch){
-        foreach($this->conf as $key => $value){
-            curl_setopt($ch, $key, $value);
-        }
-    }
-
-    /**
-     * @param string $url
-     * @param array $data HTTP POST BODY
-     * @param array $params HTTP URL
-     * @param array $headers HTTP header
-     * @return array
-     * @throws \Exception
-     */
-    public function post($url, $data=array(), $params=array(), $headers=array()){
-        $url = $this->buildUrl($url, $params);
-        $headers = array_merge($this->headers, $this->buildHeaders($headers));
-
-        $ch = curl_init();
-        $this->prepare($ch);
-        curl_setopt($ch, CURLOPT_URL, $url);
-        curl_setopt($ch, CURLOPT_POST, 1);
-        curl_setopt($ch, CURLOPT_HEADER, false);
-        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
-        curl_setopt($ch, CURLOPT_POSTFIELDS, is_array($data) ? http_build_query($data) : $data);
-        curl_setopt($ch, CURLOPT_TIMEOUT_MS, $this->socketTimeout);
-        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, $this->connectTimeout);
-        $content = curl_exec($ch);
-        $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
-
-        if($code === 0){
-            throw new \Exception(curl_error($ch));
-        }
-
-        curl_close($ch);
-        return array(
-            'code' => $code,
-            'content' => $content,
-        );
-    }
-
-    /**
-     * @param  string $url
-     * @param  array $datas HTTP POST BODY
-     * @param  array $params HTTP URL
-     * @param  array $headers HTTP header
-     * @return array
-     */
-    public function multi_post($url, $datas=array(), $params=array(), $headers=array()){
-        $url = $this->buildUrl($url, $params);
-        $headers = array_merge($this->headers, $this->buildHeaders($headers));
-
-        $chs = array();
-        $result = array();
-        $mh = curl_multi_init();
-        foreach($datas as $data){        
-            $ch = curl_init();
-            $chs[] = $ch;
-            $this->prepare($ch);
-            curl_setopt($ch, CURLOPT_URL, $url);
-            curl_setopt($ch, CURLOPT_POST, 1);
-            curl_setopt($ch, CURLOPT_HEADER, false);
-            curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-            curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
-            curl_setopt($ch, CURLOPT_POSTFIELDS, is_array($data) ? http_build_query($data) : $data);
-            curl_setopt($ch, CURLOPT_TIMEOUT_MS, $this->socketTimeout);
-            curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, $this->connectTimeout);
-            curl_multi_add_handle($mh, $ch);
-        }
-
-        $running = null;
-        do{
-            curl_multi_exec($mh, $running);
-            usleep(100);
-        }while($running);
-
-        foreach($chs as $ch){        
-            $content = curl_multi_getcontent($ch);
-            $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
-            $result[] = array(
-                'code' => $code,
-                'content' => $content,
-            );
-            curl_multi_remove_handle($mh, $ch);
-        }
-        curl_multi_close($mh);
-        
-        return $result;
-    }
-
-    /**
-     * @param  string $url
-     * @param  array $params HTTP URL
-     * @param  array $headers HTTP header
-     * @return array
-     * @throws \Exception
-     */
-    public function get($url, $params=array(), $headers=array()){
-        $url = $this->buildUrl($url, $params);
-        $headers = array_merge($this->headers, $this->buildHeaders($headers));
-
-        $ch = curl_init();
-        $this->prepare($ch);
-        curl_setopt($ch, CURLOPT_URL, $url);
-        curl_setopt($ch, CURLOPT_HEADER, false);
-        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
-        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
-        curl_setopt($ch, CURLOPT_TIMEOUT_MS, $this->socketTimeout);
-        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, $this->connectTimeout);
-        $content = curl_exec($ch);
-        $code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
-
-        if($code === 0){
-            throw new \Exception(curl_error($ch));
-        }
-        
-        curl_close($ch);
-        return array(
-            'code' => $code,
-            'content' => $content,
-        );
-    }
-
-    /**
-     * 构造 header
-     * @param  array $headers
-     * @return array
-     */
-    private function buildHeaders($headers){
-        $result = array();
-        foreach($headers as $k => $v){
-            $result[] = sprintf('%s:%s', $k, $v);
-        }
-        return $result;
-    }
-
-    /**
-     * 
-     * @param  string $url
-     * @param  array $params 参数
-     * @return string
-     */
-    private function buildUrl($url, $params){
-        if(!empty($params)){
-            $str = http_build_query($params);
-            return $url . (strpos($url, '?') === false ? '?' : '&') . $str;
-        }else{
-            return $url;
-        }
-    }
-}

+ 0 - 160
common/helpers/ocr/baidu/lib/AipHttpUtil.php

@@ -1,160 +0,0 @@
-<?php
-namespace common\helpers\ocr\baidu\lib;
-
-/**
- * BCE Util
- */
-class AipHttpUtil
-{
-    // 根据RFC 3986,除了:
-    //   1.大小写英文字符
-    //   2.阿拉伯数字
-    //   3.点'.'、波浪线'~'、减号'-'以及下划线'_'
-    // 以外都要编码
-    public static $PERCENT_ENCODED_STRINGS;
-
-    //填充编码数组
-    public static function __init()
-    {
-        AipHttpUtil::$PERCENT_ENCODED_STRINGS = array();
-        for ($i = 0; $i < 256; ++$i) {
-            AipHttpUtil::$PERCENT_ENCODED_STRINGS[$i] = sprintf("%%%02X", $i);
-        }
-
-        //a-z不编码
-        foreach (range('a', 'z') as $ch) {
-            AipHttpUtil::$PERCENT_ENCODED_STRINGS[ord($ch)] = $ch;
-        }
-
-        //A-Z不编码
-        foreach (range('A', 'Z') as $ch) {
-            AipHttpUtil::$PERCENT_ENCODED_STRINGS[ord($ch)] = $ch;
-        }
-
-        //0-9不编码
-        foreach (range('0', '9') as $ch) {
-            AipHttpUtil::$PERCENT_ENCODED_STRINGS[ord($ch)] = $ch;
-        }
-
-        //以下4个字符不编码
-        AipHttpUtil::$PERCENT_ENCODED_STRINGS[ord('-')] = '-';
-        AipHttpUtil::$PERCENT_ENCODED_STRINGS[ord('.')] = '.';
-        AipHttpUtil::$PERCENT_ENCODED_STRINGS[ord('_')] = '_';
-        AipHttpUtil::$PERCENT_ENCODED_STRINGS[ord('~')] = '~';
-    }
-
-    /**
-     * 在uri编码中不能对'/'编码
-     * @param  string $path
-     * @return string
-     */
-    public static function urlEncodeExceptSlash($path)
-    {
-        return str_replace("%2F", "/", AipHttpUtil::urlEncode($path));
-    }
-
-    /**
-     * 使用编码数组编码
-     * @param  string $value
-     * @return string
-     */
-    public static function urlEncode($value)
-    {
-        $result = '';
-        for ($i = 0; $i < strlen($value); ++$i) {
-            $result .= AipHttpUtil::$PERCENT_ENCODED_STRINGS[ord($value[$i])];
-        }
-        return $result;
-    }
-
-    /**
-     * 生成标准化QueryString
-     * @param  array $parameters
-     * @return array
-     */
-    public static function getCanonicalQueryString(array $parameters)
-    {
-        //没有参数,直接返回空串
-        if (count($parameters) == 0) {
-            return '';
-        }
-
-        $parameterStrings = array();
-        foreach ($parameters as $k => $v) {
-            //跳过Authorization字段
-            if (strcasecmp('Authorization', $k) == 0) {
-                continue;
-            }
-            if (!isset($k)) {
-                throw new \InvalidArgumentException(
-                    "parameter key should not be null"
-                );
-            }
-            if (isset($v)) {
-                //对于有值的,编码后放在=号两边
-                $parameterStrings[] = AipHttpUtil::urlEncode($k)
-                    . '=' . AipHttpUtil::urlEncode((string) $v);
-            } else {
-                //对于没有值的,只将key编码后放在=号的左边,右边留空
-                $parameterStrings[] = AipHttpUtil::urlEncode($k) . '=';
-            }
-        }
-        //按照字典序排序
-        sort($parameterStrings);
-
-        //使用'&'符号连接它们
-        return implode('&', $parameterStrings);
-    }
-
-    /**
-     * 生成标准化uri
-     * @param  string $path
-     * @return string
-     */
-    public static function getCanonicalURIPath($path)
-    {
-        //空路径设置为'/'
-        if (empty($path)) {
-            return '/';
-        } else {
-            //所有的uri必须以'/'开头
-            if ($path[0] == '/') {
-                return AipHttpUtil::urlEncodeExceptSlash($path);
-            } else {
-                return '/' . AipHttpUtil::urlEncodeExceptSlash($path);
-            }
-        }
-    }
-
-    /**
-     * 生成标准化http请求头串
-     * @param  array $headers
-     * @return array
-     */
-    public static function getCanonicalHeaders($headers)
-    {
-        //如果没有headers,则返回空串
-        if (count($headers) == 0) {
-            return '';
-        }
-
-        $headerStrings = array();
-        foreach ($headers as $k => $v) {
-            //跳过key为null的
-            if ($k === null) {
-                continue;
-            }
-            //如果value为null,则赋值为空串
-            if ($v === null) {
-                $v = '';
-            }
-            //trim后再encode,之后使用':'号连接起来
-            $headerStrings[] = AipHttpUtil::urlEncode(strtolower(trim($k))) . ':' . AipHttpUtil::urlEncode(trim($v));
-        }
-        //字典序排序
-        sort($headerStrings);
-
-        //用'\n'把它们连接起来
-        return implode("\n", $headerStrings);
-    }
-}

+ 0 - 176
common/helpers/ocr/baidu/lib/AipSampleSigner.php

@@ -1,176 +0,0 @@
-<?php
-namespace common\helpers\ocr\baidu\lib;
-
-class AipSampleSigner
-{
-
-    const BCE_AUTH_VERSION = "bce-auth-v1";
-    const BCE_PREFIX = 'x-bce-';
-
-    //不指定headersToSign情况下,默认签名http头,包括:
-    //    1.host
-    //    2.content-length
-    //    3.content-type
-    //    4.content-md5
-    public static $defaultHeadersToSign;
-
-    public static function  __init()
-    {
-        AipSampleSigner::$defaultHeadersToSign = array(
-            "host",
-            "content-length",
-            "content-type",
-            "content-md5",
-        );
-    }
-
-    /**
-     * 签名
-     * @param  array $credentials
-     * @param  string $httpMethod
-     * @param  string $path
-     * @param  array  $headers
-     * @param  string $params
-     * @param  array  $options
-     * @return string
-     */
-    public static function sign(
-        array $credentials,
-        $httpMethod,
-        $path,
-        $headers,
-        $params,
-        $options = array()
-    ) {
-        //设定签名有效时间
-        if (!isset($options[AipSignOption::EXPIRATION_IN_SECONDS])) {
-            //默认值1800秒
-            $expirationInSeconds = AipSignOption::DEFAULT_EXPIRATION_IN_SECONDS;
-        } else {
-            $expirationInSeconds = $options[AipSignOption::EXPIRATION_IN_SECONDS];
-        }
-
-        //解析ak sk
-        $accessKeyId = $credentials['ak'];
-        $secretAccessKey = $credentials['sk'];
-
-        //设定时间戳,注意:如果自行指定时间戳需要为UTC时间
-        if (!isset($options[AipSignOption::TIMESTAMP])) {
-            //默认值当前时间
-            $timestamp = gmdate('Y-m-d\TH:i:s\Z');
-        } else {
-            $timestamp = $options[AipSignOption::TIMESTAMP];
-        }
-
-        //生成authString
-        $authString = AipSampleSigner::BCE_AUTH_VERSION . '/' . $accessKeyId . '/'
-            . $timestamp . '/' . $expirationInSeconds;
-
-        //使用sk和authString生成signKey
-        $signingKey = hash_hmac('sha256', $authString, $secretAccessKey);
-
-        //生成标准化URI
-        $canonicalURI = AipHttpUtil::getCanonicalURIPath($path);
-
-        //生成标准化QueryString
-        $canonicalQueryString = AipHttpUtil::getCanonicalQueryString($params);
-
-        //填充headersToSign,也就是指明哪些header参与签名
-        $headersToSign = null;
-        if (isset($options[AipSignOption::HEADERS_TO_SIGN])) {
-            $headersToSign = $options[AipSignOption::HEADERS_TO_SIGN];
-        }
-
-        //生成标准化header
-        $canonicalHeader = AipHttpUtil::getCanonicalHeaders(
-            AipSampleSigner::getHeadersToSign($headers, $headersToSign)
-        );
-
-        //整理headersToSign,以';'号连接
-        $signedHeaders = '';
-        if ($headersToSign !== null) {
-            $signedHeaders = strtolower(
-                trim(implode(";", $headersToSign))
-            );
-        }
-
-        //组成标准请求串
-        $canonicalRequest = "$httpMethod\n$canonicalURI\n"
-            . "$canonicalQueryString\n$canonicalHeader";
-
-        //使用signKey和标准请求串完成签名
-        $signature = hash_hmac('sha256', $canonicalRequest, $signingKey);
-
-        //组成最终签名串
-        $authorizationHeader = "$authString/$signedHeaders/$signature";
-
-        return $authorizationHeader;
-    }
-
-    /**
-     * 根据headsToSign过滤应该参与签名的header
-     * @param  array $headers
-     * @param  array $headersToSign
-     * @return array
-     */
-    public static function getHeadersToSign($headers, $headersToSign)
-    {
-
-        //value被trim后为空串的header不参与签名
-        $filter_empty = function($v) {
-            return trim((string) $v) !== '';
-        };
-        $headers = array_filter($headers, $filter_empty);
-
-        //处理headers的key:去掉前后的空白并转化成小写
-        $trim_and_lower = function($str){
-            return strtolower(trim($str));
-        };
-        $temp = array();
-        $process_keys = function($k, $v) use(&$temp, $trim_and_lower) {
-            $temp[$trim_and_lower($k)] = $v;
-        };
-        array_map($process_keys, array_keys($headers), $headers);
-        $headers = $temp;
-
-        //取出headers的key以备用
-        $header_keys = array_keys($headers);
-
-        $filtered_keys = null;
-        if ($headersToSign !== null) {
-            //如果有headersToSign,则根据headersToSign过滤
-
-            //预处理headersToSign:去掉前后的空白并转化成小写
-            $headersToSign = array_map($trim_and_lower, $headersToSign);
-
-            //只选取在headersToSign里面的header
-            $filtered_keys = array_intersect_key($header_keys, $headersToSign);
-
-        } else {
-            //如果没有headersToSign,则根据默认规则来选取headers
-            $filter_by_default = function($k) {
-                return AipSampleSigner::isDefaultHeaderToSign($k);
-            };
-            $filtered_keys = array_filter($header_keys, $filter_by_default);
-        }
-
-        //返回需要参与签名的header
-        return array_intersect_key($headers, array_flip($filtered_keys));
-    }
-
-    /**
-     * 检查header是不是默认参加签名的:
-     * 1.是host、content-type、content-md5、content-length之一
-     * 2.以x-bce开头
-     * @param $header
-     * @return boolean
-     */
-    public static function isDefaultHeaderToSign($header)
-    {
-        $header = strtolower(trim($header));
-        if (in_array($header, AipSampleSigner::$defaultHeadersToSign)) {
-            return true;
-        }
-        return substr_compare($header, AipSampleSigner::BCE_PREFIX, 0, strlen(AipSampleSigner::BCE_PREFIX)) == 0;
-    }
-}

+ 0 - 17
common/helpers/ocr/baidu/lib/AipSignOption.php

@@ -1,17 +0,0 @@
-<?php
-namespace common\helpers\ocr\baidu\lib;
-
-class AipSignOption
-{
-    const EXPIRATION_IN_SECONDS = 'expirationInSeconds';
-
-    const HEADERS_TO_SIGN = 'headersToSign';
-
-    const TIMESTAMP = 'timestamp';
-
-    const DEFAULT_EXPIRATION_IN_SECONDS = 1800;
-
-    const MIN_EXPIRATION_IN_SECONDS = 300;
-
-    const MAX_EXPIRATION_IN_SECONDS = 129600;
-}

+ 2 - 2
common/libs/taskQueue/TaskFunc.php

@@ -32,8 +32,8 @@ class TaskFunc
      *
      */
     public static function autoBakBonusTable(){
-        $form = new HistoryBonusForm();
-        $form->taskAutoBackup();
+        // $form = new HistoryBonusForm();
+        // $form->taskAutoBackup();
     }
 
     /**

+ 0 - 22
common/mail/layouts/html.php

@@ -1,22 +0,0 @@
-<?php
-use yii\helpers\Html;
-
-/* @var $this \yii\web\View view component instance */
-/* @var $message \yii\mail\MessageInterface the message being composed */
-/* @var $content string main view render result */
-?>
-<?php $this->beginPage() ?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-    <meta http-equiv="Content-Type" content="text/html; charset=<?= Yii::$app->charset ?>" />
-    <title><?= Html::encode($this->title) ?></title>
-    <?php $this->head() ?>
-</head>
-<body>
-    <?php $this->beginBody() ?>
-    <?= $content ?>
-    <?php $this->endBody() ?>
-</body>
-</html>
-<?php $this->endPage() ?>

+ 0 - 14
common/mail/layouts/text.php

@@ -1,14 +0,0 @@
-<?php
-
-use yii\helpers\Html;
-
-/** @var \yii\web\View $this view component instance */
-/** @var \yii\mail\MessageInterface $message the message being composed */
-/** @var string $content main view render result */
-?>
-
-<?php $this->beginPage() ?>
-<?php $this->beginBody() ?>
-<?= $content ?>
-<?php $this->endBody() ?>
-<?php $this->endPage() ?>

+ 0 - 15
common/mail/passwordResetToken-html.php

@@ -1,15 +0,0 @@
-<?php
-use yii\helpers\Html;
-
-/* @var $this yii\web\View */
-/* @var $user common\models\User */
-
-$resetLink = Yii::$app->urlManager->createAbsoluteUrl(['site/reset-password', 'token' => $user->password_reset_token]);
-?>
-<div class="password-reset">
-    <p>Hello <?= Html::encode($user->username) ?>,</p>
-
-    <p>Follow the link below to reset your password:</p>
-
-    <p><?= Html::a(Html::encode($resetLink), $resetLink) ?></p>
-</div>

+ 0 - 12
common/mail/passwordResetToken-text.php

@@ -1,12 +0,0 @@
-<?php
-
-/* @var $this yii\web\View */
-/* @var $user common\models\User */
-
-$resetLink = Yii::$app->urlManager->createAbsoluteUrl(['site/reset-password', 'token' => $user->password_reset_token]);
-?>
-Hello <?= $user->username ?>,
-
-Follow the link below to reset your password:
-
-<?= $resetLink ?>

+ 0 - 126
common/models/Ad.php

@@ -1,126 +0,0 @@
-<?php
-
-namespace common\models;
-
-use backendApi\modules\v1\models\Admin;
-use Yii;
-use common\libs\logging\operate\valueType\Config as ValueTypeConfig;
-
-/**
- * This is the model class for table "{{%AD}}".
- *
- * @property string $ID
- * @property string $TITLE 标题
- * @property string $IMAGE 图片地址
- * @property int $TYPE 类型
- * @property string $LID 广告位ID
- * @property string $CONTENT 内容
- * @property int $SORT 排序
- * @property int $STATUS 状态
- * @property string $CREATE_ADMIN 创建管理员
- * @property string $UPDATE_ADMIN 更新管理员
- * @property int $CREATED_AT 创建时间
- * @property int $UPDATED_AT 更新时间
- */
-class Ad extends \common\components\ActiveRecord
-{
-    const TYPE_LINK = 1;        // 外链
-    const TYPE_ARTICLE = 2;     // 文章
-
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%AD}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['TITLE', 'IMAGE', 'TYPE', 'LID', 'CREATE_ADMIN', 'CREATED_AT'], 'required'],
-            [['TYPE', 'SORT', 'STATUS', 'CREATED_AT', 'UPDATED_AT'], 'integer'],
-            [['ID', 'LID', 'CREATE_ADMIN', 'UPDATE_ADMIN'], 'string', 'max' => 32],
-            [['TITLE'], 'string', 'max' => 48],
-            [['IMAGE', 'CONTENT'], 'string', 'max' => 1000],
-            [['TITLE'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'TITLE' => '标题',
-            'IMAGE' => '图片地址',
-            'TYPE' => '类型',
-            'LID' => '广告位ID',
-            'CONTENT' => '内容',
-            'SORT' => '排序',
-            'STATUS' => '状态',
-            'CREATE_ADMIN' => '创建管理员',
-            'UPDATE_ADMIN' => '更新管理员',
-            'CREATED_AT' => '创建时间',
-            'UPDATED_AT' => '更新时间',
-        ];
-    }
-
-    /**
-     * 操作日志记录条件
-     * @return array
-     */
-    public function attrLabelsWithLogType(){
-        return [
-            'TITLE' => '标题',
-            'IMAGE' => '图片地址',
-            'TYPE' => [
-                'label' => '类型',
-                'type' => function($data){
-                    $value = $data['value'];
-                    return $value==1?'外链':'文章';
-                },
-            ],
-            'LID' => [
-                'label' => '广告位',
-                'type' => function($data){
-                    $value = $data['value'];
-                    $adLocation = AdLocation::findOneAsArray('ID=:ID', [':ID'=>$value], 'LOCATION_NAME');
-                    return $adLocation['LOCATION_NAME'];
-                },
-            ],
-            'CONTENT' => '内容',
-            'SORT' => '排序',
-            'CREATE_ADMIN' => [
-                'label' => '创建人',
-                'type' => function($data){
-                    $value = is_array($data) && isset($data['value']) ? $data['value'] : '';
-                    $result = Admin::findOneAsArray('ID=:ID', [':ID'=>$value], 'ADMIN_NAME');
-                    return !empty($result) ? $result['ADMIN_NAME'] : '';
-                },
-            ],
-            'UPDATE_ADMIN' => [
-                'label' => '修改人',
-                'type' => function($data){
-                    $value = is_array($data) && isset($data['value']) ? $data['value'] : '';
-                    $result = Admin::findOneAsArray('ID=:ID', [':ID'=>$value], 'ADMIN_NAME');
-                    return !empty($result) ? $result['ADMIN_NAME'] : '';
-                },
-            ],
-            'CREATED_AT' => [
-                'label' => '创建时间',
-                'type' => ValueTypeConfig::DATE_TIME_TYPE,
-            ],
-            'UPDATED_AT' => [
-                'label' => '修改时间',
-                'type' => ValueTypeConfig::DATE_TIME_TYPE,
-            ],
-        ];
-    }
-}

+ 0 - 72
common/models/AdLocation.php

@@ -1,72 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%AD_LOCATION}}".
- *
- * @property string $ID
- * @property string $LOCATION_NAME 分类名
- * @property string $REMARK 状态
- * @property int $TYPE 类型
- * @property string $CREATE_ADMIN 创建管理员
- * @property string $UPDATE_ADMIN 更新管理员
- * @property int $CREATED_AT 创建时间
- * @property int $UPDATED_AT 更新时间
- */
-class AdLocation extends \common\components\ActiveRecord
-{
-    const TYPE_SLIDE = 1;
-    const TYPE_IMAGE = 2;
-
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%AD_LOCATION}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['LOCATION_NAME', 'REMARK', 'TYPE', 'CREATE_ADMIN', 'CREATED_AT'], 'required'],
-            [['TYPE', 'CREATED_AT', 'UPDATED_AT'], 'integer'],
-            [['ID', 'CREATE_ADMIN', 'UPDATE_ADMIN'], 'string', 'max' => 32],
-            [['LOCATION_NAME'], 'string', 'max' => 48],
-            [['REMARK'], 'string', 'max' => 255],
-            [['LOCATION_NAME'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'LOCATION_NAME' => '分类名',
-            'REMARK' => '状态',
-            'TYPE' => '类型',
-            'CREATE_ADMIN' => '创建管理员',
-            'UPDATE_ADMIN' => '更新管理员',
-            'CREATED_AT' => '创建时间',
-            'UPDATED_AT' => '更新时间',
-        ];
-    }
-
-    /**
-     * 获取全部广告为
-     * @return array
-     */
-    public static function getAllLocation(){
-        return static::find()->where('1=1')->orderBy('CREATED_AT DESC')->indexBy('ID')->asArray()->all();
-    }
-}

+ 0 - 97
common/models/ApproachDecOrder.php

@@ -1,97 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%APPROACH_DEC_ORDER}}".
- *
- * @property string $ID
- * @property string $DEC_SN 报单编号
- * @property string $ORDER_SN 订单编号
- * @property string $USER_ID 会员ID
- * @property string $TO_USER_ID 报单对象ID
- * @property string $TYPE 报单类型
- * @property int $IS_ADMIN 是否管理员操作
- * @property string $DEC_AMOUNT 报单金额
- * @property string $DEC_PV 报单PV
- * @property string $PAID_WALLET 支付钱包
- * @property int $IS_BATCH 是否批量报单
- * @property string $REMARK 备注
- * @property string $REC_USER_ID 推荐人ID
- * @property string $CON_USER_ID 接点人ID
- * @property string $DEC_ID 报单中心ID
- * @property int $PERIOD_NUM 报单期数
- * @property string $P_CALC_MONTH 分区结算月
- * @property int $CALC_MONTH 结算月
- * @property int $CREATED_AT 创建时间
- * @property string $UPDATER 操作人
- * @property string $UPDATED_AT 更新时间
- * @property int $IS_DEL 是否删除
- * @property int $DELETED_AT 删除时间
- * @property int $DETAIL_TYPE 类型
- * @property int $UPGRADE_TYPE 升级类型
- * @property string $ORI_LV 升级前级别
- * @property string $UPGRADE_LV 升级后级别
- */
-class ApproachDecOrder extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%APPROACH_DEC_ORDER}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'TO_USER_ID','REC_USER_ID','CON_USER_ID','DEC_ID', 'TYPE', 'PAID_WALLET', 'PERIOD_NUM', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['IS_ADMIN', 'IS_BATCH', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'IS_DEL', 'DELETED_AT'], 'integer'],
-            [['DEC_AMOUNT', 'DEC_PV'], 'number'],
-            [['ID', 'DEC_SN', 'ORDER_SN', 'USER_ID', 'TO_USER_ID','REC_USER_ID','CON_USER_ID','DEC_ID', 'TYPE', 'UPDATER', 'UPDATED_AT'], 'string', 'max' => 32],
-            [['PAID_WALLET'], 'string', 'max' => 48],
-            [['REMARK'], 'string', 'max' => 4000],
-            [['DEC_SN'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'DEC_SN' => '报单编号',
-            'ORDER_SN' => '订单编号',
-            'USER_ID' => '会员ID',
-            'TO_USER_ID' => '报单对象ID',
-            'TYPE' => '报单类型',
-            'IS_ADMIN' => '是否管理员操作',
-            'DEC_AMOUNT' => '报单金额',
-            'DEC_PV' => '报单PV',
-            'PAID_WALLET' => '支付钱包',
-            'STATUS' => '支付状态',
-            'IS_BATCH' => '是否批量报单',
-            'REMARK' => '备注',
-            'REC_USER_ID' => '开拓人编号',
-            'CON_USER_ID' => '上级编号',
-            'DEC_ID' => '上级编号',
-            'PERIOD_NUM' => '报单期数',
-            'P_CALC_MONTH' => '分区结算月',
-            'CALC_MONTH' => '结算月',
-            'CREATED_AT' => '创建时间',
-            'UPDATER' => '操作人',
-            'UPDATED_AT' => '更新时间',
-            'IS_DEL' => '是否删除',
-            'DELETED_AT' => '删除时间',
-        ];
-    }
-}

+ 0 - 136
common/models/ApproachOrder.php

@@ -1,136 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER}}".
- *
- * @property string $ID
- * @property string $SN 订单号
- * @property string $DEC_SN 报单编号
- * @property string $USER_ID 用户ID
- * @property string $USER_NAME 会员编号
- * @property string $ORDER_TYPE 订货类型
- * @property string $ORDER_AMOUNT 订单总价格
- * @property string $PV 订货PV
- * @property string $PAY_AMOUNT 支付价格
- * @property string $PAY_PV 实付PV
- * @property int $PAY_AT 支付时间
- * @property string $PAY_TYPE 支付方式
- * @property string $FREIGHT 运费
- * @property string $PAY_FREIGHT 实付运费金额
- * @property int $DELIVERY_STATUS 发货状态
- * @property int $DELIVERY_PERIOD 发货期数
- * @property int $DELIVERY_AT 发货时间
- * @property string $EXPRESS_COMPANY 快递公司
- * @property string $ORDER_TRACK_NO 快递单号
- * @property int $EXPRESS_TYPE 发货方式
- * @property string $FRONT_REMARK 前台备注
- * @property string $REMARK 后台备注
- * @property int $PERIOD_NUM 期数
- * @property int $STATUS 订单状态
- * @property string $CONSIGNEE 收货人
- * @property string $MOBILE 收货人手机
- * @property string $TEL 固定电话
- * @property int $PROVINCE 省份名称
- * @property int $CITY 城市名称
- * @property int $COUNTY 县区
- * @property string $ADDRESS 详细地址
- * @property string $P_CALC_MONTH 分区日期
- * @property int $CREATED_AT 订单创建时间
- * @property string $CREATE_USER 订单创建人
- * @property int $UPDATED_AT 修改时间
- * @property string $UPDATER 修改人
- * @property int $IS_DELETE 是否删除
- * @property int $DELETED_AT 删除时间
- * @property int $WAREHOUSE 发货仓
- * @property string $EMAIL 邮箱
- * @property string $NOTE 备注说明
- * @property string $LGA_NAME LGA_NAME
- * @property string $CITY_NAME 城市
- */
-class ApproachOrder extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%APPROACH_ORDER}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'USER_NAME', 'ORDER_TYPE', 'CREATE_USER'], 'required'],
-            [['ORDER_AMOUNT', 'PV', 'PAY_AMOUNT', 'PAY_PV', 'FREIGHT', 'PAY_FREIGHT'], 'number'],
-            [['PAY_AT', 'DELIVERY_STATUS', 'DELIVERY_PERIOD', 'DELIVERY_AT', 'EXPRESS_TYPE', 'PERIOD_NUM', 'STATUS', 'PROVINCE', 'CITY', 'COUNTY', 'CREATED_AT', 'UPDATED_AT', 'IS_DELETE', 'DELETED_AT'], 'integer'],
-            [['ID','SN', 'DEC_SN', 'USER_ID', 'ORDER_TRACK_NO','PAY_TYPE'], 'string', 'max' => 32],
-            [['USER_NAME', 'TEL', 'CREATE_USER', 'UPDATER', 'WAREHOUSE'], 'string', 'max' => 16],
-            [['ORDER_TYPE'], 'string', 'max' => 12],
-            [['EXPRESS_COMPANY'], 'string', 'max' => 128],
-            [['FRONT_REMARK'], 'string', 'max' => 1000],
-            [['REMARK', 'NOTE'], 'string', 'max' => 4000],
-            [['CONSIGNEE'], 'string', 'max' => 120],
-            [['MOBILE'], 'string', 'max' => 11],
-            [['ADDRESS'], 'string', 'max' => 255],
-            [['SN'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'SN' => '订单号',
-            'DEC_SN' => '报单编号',
-            'USER_ID' => '用户ID',
-            'USER_NAME' => '会员编号',
-            'ORDER_TYPE' => '订货类型',
-            'ORDER_AMOUNT' => '订单总价格',
-            'PV' => '订货BV',
-            'PAY_AMOUNT' => '支付价格',
-            'PAY_PV' => '实付BV',
-            'PAY_AT' => '支付时间',
-            'PAY_TYPE' => '支付方式',
-            'FREIGHT' => '运费',
-            'PAY_FREIGHT' => '实付运费金额',
-            'DELIVERY_STATUS' => '发货状态',
-            'DELIVERY_PERIOD' => '发货期数',
-            'DELIVERY_AT' => '发货时间',
-            'EXPRESS_COMPANY' => '快递公司',
-            'ORDER_TRACK_NO' => '快递单号',
-            'EXPRESS_TYPE' => '发货方式',
-            'FRONT_REMARK' => '前台备注',
-            'REMARK' => '后台备注',
-            'PERIOD_NUM' => '期数',
-            'STATUS' => '订单状态',
-            'CONSIGNEE' => '收货人',
-            'MOBILE' => '收货人手机',
-            'TEL' => '固定电话',
-            'PROVINCE' => '省份名称',
-            'CITY' => '城市名称',
-            'COUNTY' => '县区',
-            'LGA_NAME' => 'lga name',
-            'CITY_NAME' => 'City name',
-            'ADDRESS' => '详细地址',
-            'P_CALC_MONTH' => '分区日期',
-            'CREATED_AT' => '订单创建时间',
-            'CREATE_USER' => '订单创建人',
-            'UPDATED_AT' => '修改时间',
-            'UPDATER' => '修改人',
-            'IS_DELETE' => '是否删除',
-            'DELETED_AT' => '删除时间',
-            'WAREHOUSE' => '发货仓',
-            'EMAIL' => 'Email'
-        ];
-    }
-}

+ 0 - 71
common/models/ApproachOrderCall.php

@@ -1,71 +0,0 @@
-<?php
-
-namespace common\models;
-
-use common\components\MongoActiveRecord;
-use Yii;
-
-/**
- * This is the model class for collection "ar_approach_order_call".
- *
- * @property \MongoDB\BSON\ObjectID|string $_id
- * @property string $sn 订单号
- * @property string $reference 支付唯一凭证
- * @property mixed $event 事件
- * @property mixed $data 回调内容
-
- */
-class ApproachOrderCall extends MongoActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function collectionName()
-    {
-        return 'ar_approach_order_call';
-    }
-
-    /**
-     * @return \yii\mongodb\Connection the MongoDB connection used by this AR class.
-     */
-    public static function getDb()
-    {
-        return Yii::$app->get('dbLog');
-    }
-
-    /**
-     * 获取id
-     * @return string
-     */
-    public function getId() {
-        return (string) $this->_id;
-    }
-    /**
-     * {@inheritdoc}
-     */
-    public function attributes()
-    {
-        return [
-            '_id',
-            'sn',
-            'reference',
-            'event',
-            'data',
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            '_id' => 'objectID',
-            'sn' => 'orderSn',
-            'reference' => 'reference',
-            'event' => 'event',
-            'data' => 'data',
-        ];
-    }
-
-}

+ 0 - 77
common/models/ApproachOrderGoods.php

@@ -1,77 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER_GOODS}}".
- *
- * @property string $ID
- * @property string $ORDER_SN 订单ID
- * @property string $GOODS_ID 商品ID
- * @property string $GOODS_TITLE 商品名称
- * @property string $PRICE 价格
- * @property string $REAL_PRICE 实际价格
- * @property string $PV 订货PV
- * @property string $REAL_PV 实际PV
- * @property string $TAX_RATE 税率
- * @property string $POINT 兑换积分
- * @property string $SKU_CODE 商品编码
- * @property int $BUY_NUMS 购买数量
- * @property string $P_CALC_MONTH 分区日期
- * @property int CATEGORY_TYPE 商品分类
- * @property int PAY_TYPE 支付方式
- * @property string $EMAIL Email
- */
-class ApproachOrderGoods extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%APPROACH_ORDER_GOODS}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ORDER_SN', 'GOODS_ID', 'GOODS_TITLE', 'SKU_CODE', 'CATEGORY_TYPE', 'PAY_TYPE', 'EMAIL'], 'required'],
-            [['PRICE', 'REAL_PRICE', 'PV', 'REAL_PV', 'POINT', 'CATEGORY_TYPE', 'PAY_TYPE', 'TAX_RATE'], 'number'],
-            [['BUY_NUMS'], 'integer'],
-            [['ID', 'ORDER_SN', 'GOODS_ID'], 'string', 'max' => 32],
-            [['GOODS_TITLE'], 'string', 'max' => 255],
-            [['SKU_CODE'], 'string', 'max' => 16],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'ORDER_SN' => '订单ID',
-            'GOODS_ID' => '商品ID',
-            'GOODS_TITLE' => '商品名称',
-            'PRICE' => '价格',
-            'REAL_PRICE' => '实际价格',
-            'PV' => '订货BV',
-            'REAL_PV' => '实际BV',
-            'TAX_RATE' => '税率',
-            'POINT' => '兑换积分',
-            'SKU_CODE' => '商品编码',
-            'BUY_NUMS' => '购买数量',
-            'P_CALC_MONTH' => '分区日期',
-            'CATEGORY_TYPE' => '商品分类',
-            'PAY_TYPE' => '支付方式',
-            'EMAIL' => 'Email'
-        ];
-    }
-}

+ 0 - 59
common/models/Article.php

@@ -1,59 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ARTICLE}}".
- *
- * @property string $ID
- * @property string $TITLE 标题
- * @property string $CID 分类ID
- * @property string $CONTENT 内容
- * @property int $STATUS 状态
- * @property int $SORT 排序值
- * @property int $CREATED_AT 创建时间
- */
-class Article extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%ARTICLE}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['CID', 'CREATED_AT'], 'required'],
-            [['STATUS', 'CREATED_AT', 'SORT'], 'integer'],
-            [['ID', 'CID'], 'string', 'max' => 32],
-            [['TITLE'], 'string', 'max' => 255],
-            [['CONTENT'], 'string', 'max' => 4000],
-            [['TITLE'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'TITLE' => 'Title', // 标题
-            'CID' => 'Category Type', // 分类
-            'CONTENT' => 'Content', // 内容
-            'STATUS' => 'State', // 状态
-            'Order' => 'Sort', // 排序
-            'CREATED_AT' => 'Creation Time', // 创建时间
-        ];
-    }
-}

+ 0 - 62
common/models/ArticleCategory.php

@@ -1,62 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ARTICLE_CATEGORY}}".
- *
- * @property string $ID
- * @property string $CATE_NAME 分类名
- * @property int $SORT
- * @property int $STATUS 状态
- * @property int $CREATED_AT 创建时间
- */
-class ArticleCategory extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%ARTICLE_CATEGORY}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['CATE_NAME', 'CREATED_AT'], 'required'],
-            [['SORT', 'STATUS', 'CREATED_AT'], 'integer'],
-            [['ID'], 'string', 'max' => 32],
-            [['CATE_NAME'], 'string', 'max' => 20],
-            [['CATE_NAME'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'CATE_NAME' => '分类名',
-            'STATUS' => '状态',
-            'SORT' => 'Sort',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-
-    /**
-     * 获取全部分类
-     * @return array|\yii\db\ActiveRecord[]
-     */
-    public static function getAllCategory(){
-        return ArticleCategory::find()->where('STATUS=1')->indexBy('ID')->orderBy('SORT ASC')->asArray()->all();
-    }
-}

+ 0 - 178
common/models/BalanceAudit.php

@@ -1,178 +0,0 @@
-<?php
-
-namespace common\models;
-
-use backendApi\modules\v1\models\Admin;
-use common\helpers\user\Info;
-use Yii;
-use common\libs\logging\operate\valueType\Config as ValueTypeConfig;
-
-/**
- * This is the model class for table "{{%BALANCE_AUDIT}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 申请时会员级别
- * @property string $LAST_EMP_LV 申请时会员聘级
- * @property string $LAST_DEC_ROLE_ID 申请时报单中心级别
- * @property string $TYPE 余额类型
- * @property string $DEAL_TYPE 交易类型
- * @property string $AMOUNT 金额
- * @property int $AUDIT_STATUS 状态
- * @property string $UPDATE_ADMIN_ID 变更管理员
- * @property string $AUDIT_ADMIN_ID 审核管理员
- * @property string $CREATE_REMARK 创建备注
- * @property string $AUDIT_REMARK 审核备注
- * @property int $REMARK_IS_SHOW 前台是否展示
- * @property int $CREATED_AT 创建时间
- * @property int $AUDITED_AT  审核时间
- */
-class BalanceAudit extends \common\components\ActiveRecord
-{
-    const TYPE = [
-        'bonus' => [
-            'name' => 'bonus',
-            'label' => 'Member bonus account',//会员账户奖金
-        ],
-//        'reconsume_points' => [
-//            'name' => 'reconsume_points',
-//            'label' => '复消积分',
-//        ],
-//        'exchange_points' => [
-//            'name' => 'exchange_points',
-//            'label' => '兑换积分',
-//        ],
-        'cash' => [
-            'name' => 'cash',
-            'label' => 'Member Ecoin account',// 会员账户余额
-        ],
-//        'cf' => [
-//            'name' => 'cf',
-//            'label' => '车房养老奖余额',
-//        ],
-//        'lx' => [
-//            'name' => 'lx',
-//            'label' => '领袖分红奖余额',
-//        ],
-//        'tourism_points' => [
-//            'name' => 'tourism_points',
-//            'label' => '旅游积分',
-//        ],
-        'garage_points' => [
-            'name' => 'garage_points',
-            'label' => 'Car points',// 车奖积分
-        ],
-        'villa_points' => [
-            'name' => 'villa_points',
-            'label' => 'Villa points',// 房奖积分
-        ],
-    ];
-
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%BALANCE_AUDIT}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'TYPE', 'DEAL_TYPE', 'CREATED_AT'], 'required'],
-            [['AMOUNT'], 'number'],
-            [['AUDIT_STATUS', 'REMARK_IS_SHOW', 'CREATED_AT', 'AUDITED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'LAST_DEC_ROLE_ID', 'DEAL_TYPE', 'UPDATE_ADMIN_ID', 'AUDIT_ADMIN_ID'], 'string', 'max' => 32],
-            [['TYPE'], 'string', 'max' => 48],
-            [['CREATE_REMARK', 'AUDIT_REMARK'], 'string', 'max' => 4000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '申请时会员级别',
-            'LAST_EMP_LV' => '申请时会员聘级',
-            'LAST_DEC_ROLE_ID' => '申请时报单中心级别',
-            'TYPE' => '余额类型',
-            'DEAL_TYPE' => '交易类型',
-            'AMOUNT' => '金额',
-            'AUDIT_STATUS' => '状态',
-            'UPDATE_ADMIN_ID' => '变更管理员',
-            'AUDIT_ADMIN_ID' => '审核管理员',
-            'CREATE_REMARK' => '创建备注',
-            'AUDIT_REMARK' => '审核备注',
-            'REMARK_IS_SHOW' => '前台是否展示',
-            'CREATED_AT' => '创建时间',
-            'AUDITED_AT' => ' 审核时间',
-        ];
-    }
-
-    /**
-     * 操作日志记录条件
-     * @return array
-     */
-    public function attrLabelsWithLogType(){
-        return [
-            'USER_ID' => '会员ID',
-            'TYPE' => [
-                'label' => '余额类型',
-                'type' => function($data){
-                    $value = $data['value'];
-                    return \Yii::$app->params['bonusWalletType'][$value]['label'];
-                },
-            ],
-            'DEAL_TYPE' => [
-                'label' => '交易类型',
-                'type' => function($data){
-                    $value = $data['value'];
-                    $dealType = DealType::findOneAsArray('ID=:ID', [':ID'=>$value], 'TYPE_NAME');
-                    return $dealType['TYPE_NAME'];
-                },
-            ],
-            'AMOUNT' => '金额',
-            'AUDIT_STATUS' => [
-                'label' => '审核状态',
-                'type' => ValueTypeConfig::AUDIT_STATUS_TYPE,
-            ],
-            'UPDATE_ADMIN_ID' => [
-                'label' => '变更管理员',
-                'type' => function($data){
-                    $value = is_array($data) && isset($data['value']) ? $data['value'] : '';
-                    $result = Admin::findOneAsArray('ID=:ID', [':ID'=>$value], 'ADMIN_NAME');
-                    return !empty($result) ? $result['ADMIN_NAME'] : '';
-                },
-            ],
-            'AUDIT_ADMIN_ID' => [
-                'label' => '审核管理员',
-                'type' => function($data){
-                    $value = is_array($data) && isset($data['value']) ? $data['value'] : '';
-                    $result = Admin::findOneAsArray('ID=:ID', [':ID'=>$value], 'ADMIN_NAME');
-                    return !empty($result) ? $result['ADMIN_NAME'] : '';
-                },
-            ],
-            'CREATE_REMARK' => '备注',
-            'REMARK_IS_SHOW' => [
-                'label' => '前台是否显示备注',
-                'type' => ValueTypeConfig::YES_NO_TYPE,
-            ],
-            'CREATED_AT' => [
-                'label' => '创建时间',
-                'type' => ValueTypeConfig::DATE_TIME_TYPE,
-            ],
-            'AUDITED_AT' => [
-                'label' => '审核时间',
-                'type' => ValueTypeConfig::DATE_TIME_TYPE,
-            ],
-        ];
-    }
-}

+ 0 - 102
common/models/CFLXAudit.php

@@ -1,102 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-use common\libs\logging\operate\valueType\Config as ValueTypeConfig;
-
-/**
- * This is the model class for table "{{%CF_LX_AUDIT}}".
- *
- * @property string $ID
- * @property string $USER_ID
- * @property string $CF 车房养老
- * @property string $LX 领袖分红
- * @property int $YEAR 类型
- * @property int $AUDIT_STATUS 审核状态
- * @property string $CREATE_ADMIN 创建管理员
- * @property string $AUDIT_ADMIN 审核管理员
- * @property string $CREATE_REMARK 申请备注
- * @property string $AUDIT_REMARK 审核备注
- * @property int $CREATED_AT 创建时间
- * @property int $AUDITED_AT 审核时间
- */
-class CFLXAudit extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%CF_LX_AUDIT}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['YEAR', 'AUDIT_STATUS', 'CREATED_AT', 'AUDITED_AT'], 'integer'],
-            [['CREATE_ADMIN', 'CREATED_AT', 'USER_ID'], 'required'],
-            [['CF','LX'], 'number'],
-            [['ID', 'USER_ID', 'CREATE_ADMIN', 'AUDIT_ADMIN'], 'string', 'max' => 32],
-            [['CREATE_REMARK', 'AUDIT_REMARK'], 'string', 'max' => 4000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '用户ID',
-            'LX' => '车房养老',
-            'CF' => '领袖分红',
-            'YEAR' => '年',
-            'AUDIT_STATUS' => '审核状态',
-            'CREATE_ADMIN' => '创建管理员',
-            'AUDIT_ADMIN' => '审核管理员',
-            'CREATE_REMARK' => '申请备注',
-            'AUDIT_REMARK' => '审核备注',
-            'CREATED_AT' => '创建时间',
-            'AUDITED_AT' => '审核时间',
-        ];
-    }
-
-    /**
-     * 操作日志记录条件
-     * @return array
-     */
-    public function attrLabelsWithLogType(){
-        return [
-            'USER_ID' => '会员ID',
-            'CF' => '车房养老',
-            'LX' => '领袖分红',
-            'AUDIT_STATUS' => [
-                'label' => '审核状态',
-                'type' => ValueTypeConfig::AUDIT_STATUS_TYPE,
-            ],
-            'CREATE_ADMIN' => [
-                'label' => '申请管理员',
-                'type' => ValueTypeConfig::ADMIN_TYPE,
-            ],
-            'AUDIT_ADMIN' => [
-                'label' => '审核管理员',
-                'type' => ValueTypeConfig::ADMIN_TYPE,
-            ],
-            'CREATE_REMARK' => '备注',
-            'CREATED_AT' => [
-                'label' => '申请时间',
-                'type' => ValueTypeConfig::DATE_TIME_TYPE,
-            ],
-            'AUDITED_AT' => [
-                'label' => '审核时间',
-                'type' => ValueTypeConfig::DATE_TIME_TYPE,
-            ],
-        ];
-    }
-}

+ 0 - 111
common/models/CalcBonusBT.php

@@ -1,111 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_BT}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时会员状态
- * @property string $FROM_USER_ID 来源会员ID
- * @property string $LAST_FROM_DEC_LV 结算时来源会员级别
- * @property string $LAST_FROM_EMP_LV 结算时来源会员聘级
- * @property int $LAST_FROM_STATUS 结算时来源会员状态
- * @property string $LAST_DEC_ROLE_ID 结算时会员报单级别
- * @property string $BT_TYPE 补贴类型
- * @property string $FROM_ORDER_SN 来源订单编号
- * @property int $ORDER_TIME 订货时间
- * @property int $ORDER_PERIOD 订货期数
- * @property int $DELIVERY_AT 发货时间
- * @property int $DELIVERY_PERIOD 发货期数
- * @property string $PAY_AMOUNT 订货金额
- * @property string $PAY_PV 订货积分
- * @property string $TRANSFER_SN 转账记录流水号
- * @property string $TRANSFER_AMOUNT 转账金额
- * @property int $TRANSFER_AT 转账时间
- * @property int $TRANSFER_PERIOD 转账期数
- * @property string $AMOUNT 店补金额
- * @property string $LOGS 日志
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_YEAR 所在结算年
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_CALC_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- */
-class CalcBonusBT extends \common\components\ActiveRecord
-{
-    const TYPE_NAME = [
-        'ORDER' => '服务费',//'订货店补',
-        'TRANS' => '转账补助',//'转账店补',
-        'PROD' => '产品补贴',//'产品补贴',
-        'TOOL' => '工具流补贴',//'工具流补贴',
-    ];
-
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_BT}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'FROM_USER_ID', 'BT_TYPE', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['LAST_STATUS', 'LAST_FROM_STATUS', 'ORDER_TIME', 'ORDER_PERIOD', 'DELIVERY_AT', 'DELIVERY_PERIOD', 'TRANSFER_AT', 'TRANSFER_PERIOD', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['PAY_AMOUNT', 'PAY_PV', 'TRANSFER_AMOUNT', 'AMOUNT'], 'number'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'FROM_USER_ID', 'LAST_FROM_DEC_LV', 'LAST_FROM_EMP_LV', 'LAST_DEC_ROLE_ID', 'FROM_ORDER_SN', 'TRANSFER_SN'], 'string', 'max' => 32],
-            [['BT_TYPE'], 'string', 'max' => 8],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['P_CALC_MONTH'], 'string', 'max' => 7],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时会员状态',
-            'FROM_USER_ID' => '来源会员ID',
-            'LAST_FROM_DEC_LV' => '结算时来源会员级别',
-            'LAST_FROM_EMP_LV' => '结算时来源会员聘级',
-            'LAST_FROM_STATUS' => '结算时来源会员状态',
-            'LAST_DEC_ROLE_ID' => '结算时会员报单级别',
-            'BT_TYPE' => '补贴类型',
-            'FROM_ORDER_SN' => '来源订单编号',
-            'ORDER_TIME' => '订货时间',
-            'ORDER_PERIOD' => '订货期数',
-            'DELIVERY_AT' => '发货时间',
-            'DELIVERY_PERIOD' => '发货期数',
-            'PAY_AMOUNT' => '订货金额',
-            'PAY_PV' => '订货积分',
-            'TRANSFER_SN' => '转账记录流水号',
-            'TRANSFER_AMOUNT' => '转账金额',
-            'TRANSFER_AT' => '转账时间',
-            'TRANSFER_PERIOD' => '转账期数',
-            'AMOUNT' => '店补金额',
-            'LOGS' => '日志',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_YEAR' => '所在结算年',
-            'CALC_MONTH' => '所在结算月',
-            'P_CALC_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}

+ 0 - 73
common/models/CalcBonusCF.php

@@ -1,73 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_CF}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $FROM_USER_ID 来源会员ID
- * @property string $FROM_DEC_SN 来源报单编号
- * @property string $AMOUNT 奖金金额
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_YEAR 所在结算年
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_CALC_MONTH 表分区的日期索引
- * @property string $LOGS 日志
- * @property int $CREATED_AT 创建时间
- */
-class CalcBonusCF extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_CF}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'FROM_USER_ID', 'FROM_DEC_SN', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT'], 'number'],
-            [['LAST_STATUS', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'FROM_USER_ID', 'FROM_DEC_SN', 'LAST_DEC_LV', 'LAST_EMP_LV'], 'string', 'max' => 32],
-            [['P_CALC_MONTH'], 'safe'],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'FROM_USER_ID' => '来源会员ID',
-            'FROM_DEC_SN' => '来源报单编号',
-            'AMOUNT' => '奖金金额',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_YEAR' => '所在结算年',
-            'CALC_MONTH' => '所在结算月',
-            'P_CALC_MONTH' => '表分区的日期索引',
-            'LOGS' => '日志',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}

+ 0 - 79
common/models/CalcBonusFL.php

@@ -1,79 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_FL}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_ROLE_ID 结算时报单级别
- * @property string $DEC_SN 报单编号
- * @property string $TO_USER_ID 被报单会员ID
- * @property int $DEC_AT 报单时间
- * @property int $DEC_PERIOD 报单期数
- * @property string $DEC_AMOUNT 报单金额
- * @property string $DEC_PV 报单PV
- * @property string $AMOUNT 奖金金额
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_YEAR 所在结算年
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_CALC_MONTH 表分区的日期索引
- * @property string $ORDER_PV 区域业绩
- * @property string $LOGS 日志
- * @property int $CREATED_AT 创建时间
- */
-class CalcBonusFL extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_FL}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'LAST_DEC_ROLE_ID', 'DEC_SN', 'TO_USER_ID', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['DEC_AT', 'DEC_PERIOD', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['DEC_AMOUNT', 'DEC_PV', 'AMOUNT', 'ORDER_PV'], 'number'],
-            [['ID', 'USER_ID', 'LAST_DEC_ROLE_ID', 'DEC_SN', 'TO_USER_ID'], 'string', 'max' => 32],
-            [['P_CALC_MONTH'], 'string', 'max' => 7],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_ROLE_ID' => '结算时报单级别',
-            'DEC_SN' => '报单编号',
-            'TO_USER_ID' => '被报单会员ID',
-            'DEC_AT' => '报单时间',
-            'DEC_PERIOD' => '报单期数',
-            'DEC_AMOUNT' => '报单金额',
-            'DEC_PV' => '报单PV',
-            'AMOUNT' => '奖金金额',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_YEAR' => '所在结算年',
-            'CALC_MONTH' => '所在结算月',
-            'P_CALC_MONTH' => '表分区的日期索引',
-            'ORDER_PV' => '区域业绩',
-            'LOGS' => '日志',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}

+ 0 - 80
common/models/CalcBonusFW.php

@@ -1,80 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_FW}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $FROM_USER_ID 来源会员ID
- * @property string $LAST_FROM_DEC_LV 结算时来源会员级别
- * @property string $LAST_FROM_EMP_LV 结算时来源会员聘级
- * @property int $LAST_FROM_STATUS 结算时来源状态
- * @property string $AMOUNT 金额
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_MONTH 所在结算月
- * @property int $CALCULATED_AT 结算时间
- * @property int $CREATED_AT 创建时间
- * @property string $LOGS 日志
- * @property $ORI_BONUS 原奖金
- * @property $RECONSUME_POINTS 重复消费积分
- * @property $MANAGE_TAX 管理费
- */
-class CalcBonusFW extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_FW}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'PERIOD_NUM', 'CALC_MONTH', 'CALCULATED_AT', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'ORI_BONUS', 'RECONSUME_POINTS', 'MANAGE_TAX'], 'number'],
-            [['LAST_STATUS', 'PERIOD_NUM', 'CALC_MONTH', 'CALCULATED_AT', 'CREATED_AT', 'LAST_FROM_STATUS'], 'integer'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'FROM_USER_ID',  'LAST_FROM_DEC_LV', 'LAST_FROM_EMP_LV'], 'string', 'max' => 32],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'FROM_USER_ID' => '来源会员ID',
-            'LAST_FROM_DEC_LV' => '结算时来源会员级别',
-            'LAST_FROM_EMP_LV' => '结算时来源会员聘级',
-            'LAST_FROM_STATUS' => '结算时来源状态',
-            'AMOUNT' => '金额',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_MONTH' => '所在结算月',
-            'CALCULATED_AT' => '结算时间',
-            'CREATED_AT' => '创建时间',
-            'LOGS' => '日志',
-            'ORI_BONUS' => '原奖金',
-            'RECONSUME_POINTS' => '重复消费积分',
-            'MANAGE_TAX' => '管理费',
-        ];
-    }
-}

+ 0 - 77
common/models/CalcBonusFX.php

@@ -1,77 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_FX}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $FROM_USER_ID 来源会员ID
- * @property string $LAST_FROM_DEC_LV 结算时来源会员级别
- * @property string $LAST_FROM_EMP_LV 结算时来源会员聘级
- * @property int $LAST_FROM_STATUS 结算时来源状态
- * @property int $DEEP 深度
- * @property string $AMOUNT 奖金金额
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_CALC_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- * @property string $LOGS 日志
- */
-class CalcBonusFX extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_FX}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'FROM_USER_ID', 'DEEP', 'PERIOD_NUM', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['LAST_STATUS', 'LAST_FROM_STATUS', 'DEEP', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['AMOUNT'], 'number'],
-            [['ID', 'USER_ID', 'FROM_USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'LAST_FROM_DEC_LV', 'LAST_FROM_EMP_LV'], 'string', 'max' => 32],
-            [['P_CALC_MONTH'], 'safe'],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'FROM_USER_ID' => '来源会员ID',
-            'LAST_FROM_DEC_LV' => '结算时来源会员级别',
-            'LAST_FROM_EMP_LV' => '结算时来源会员聘级',
-            'LAST_FROM_STATUS' => '结算时来源状态',
-            'DEEP' => '深度',
-            'AMOUNT' => '奖金金额',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_MONTH' => '所在结算月',
-            'P_CALC_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-            'LOGS' => '日志',
-        ];
-    }
-}

+ 0 - 80
common/models/CalcBonusGL.php

@@ -1,80 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_GL}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $FROM_USER_ID 来源会员ID
- * @property string $LAST_FROM_DEC_LV 结算时来源会员级别
- * @property string $LAST_FROM_EMP_LV 结算时来源会员聘级
- * @property int $LAST_FROM_STATUS 结算时来源状态
- * @property string $AMOUNT 金额
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_MONTH 所在结算月
- * @property int $CALCULATED_AT 结算时间
- * @property int $CREATED_AT 创建时间
- * @property string $LOGS 日志
- * @property $ORI_BONUS 原奖金
- * @property $RECONSUME_POINTS 重复消费积分
- * @property $MANAGE_TAX 管理费
- */
-class CalcBonusGL extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_GL}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'PERIOD_NUM', 'CALC_MONTH', 'CALCULATED_AT', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'ORI_BONUS', 'RECONSUME_POINTS', 'MANAGE_TAX'], 'number'],
-            [['LAST_STATUS', 'PERIOD_NUM', 'CALC_MONTH', 'CALCULATED_AT', 'CREATED_AT', 'LAST_FROM_STATUS'], 'integer'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'FROM_USER_ID',  'LAST_FROM_DEC_LV', 'LAST_FROM_EMP_LV'], 'string', 'max' => 32],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'FROM_USER_ID' => '来源会员ID',
-            'LAST_FROM_DEC_LV' => '结算时来源会员级别',
-            'LAST_FROM_EMP_LV' => '结算时来源会员聘级',
-            'LAST_FROM_STATUS' => '结算时来源状态',
-            'AMOUNT' => '金额',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_MONTH' => '所在结算月',
-            'CALCULATED_AT' => '结算时间',
-            'CREATED_AT' => '创建时间',
-            'LOGS' => '日志',
-            'ORI_BONUS' => '原奖金',
-            'RECONSUME_POINTS' => '重复消费积分',
-            'MANAGE_TAX' => '管理费',
-        ];
-    }
-}

+ 0 - 80
common/models/CalcBonusGX.php

@@ -1,80 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_GX}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $FROM_USER_ID 来源会员ID
- * @property string $LAST_FROM_DEC_LV 结算时来源会员级别
- * @property string $LAST_FROM_EMP_LV 结算时来源会员聘级
- * @property int $LAST_FROM_STATUS 结算时来源状态
- * @property string $AMOUNT 金额
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_MONTH 所在结算月
- * @property int $CALCULATED_AT 结算时间
- * @property int $CREATED_AT 创建时间
- * @property string $LOGS 日志
- * @property $ORI_BONUS 原奖金
- * @property $RECONSUME_POINTS 重复消费积分
- * @property $MANAGE_TAX 管理费
- */
-class CalcBonusGX extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_GX}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'PERIOD_NUM', 'CALC_MONTH', 'CALCULATED_AT', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'ORI_BONUS', 'RECONSUME_POINTS', 'MANAGE_TAX'], 'number'],
-            [['LAST_STATUS', 'PERIOD_NUM', 'CALC_MONTH', 'CALCULATED_AT', 'CREATED_AT', 'LAST_FROM_STATUS'], 'integer'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'FROM_USER_ID',  'LAST_FROM_DEC_LV', 'LAST_FROM_EMP_LV'], 'string', 'max' => 32],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'FROM_USER_ID' => '来源会员ID',
-            'LAST_FROM_DEC_LV' => '结算时来源会员级别',
-            'LAST_FROM_EMP_LV' => '结算时来源会员聘级',
-            'LAST_FROM_STATUS' => '结算时来源状态',
-            'AMOUNT' => '金额',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_MONTH' => '所在结算月',
-            'CALCULATED_AT' => '结算时间',
-            'CREATED_AT' => '创建时间',
-            'LOGS' => '日志',
-            'ORI_BONUS' => '原奖金',
-            'RECONSUME_POINTS' => '重复消费积分',
-            'MANAGE_TAX' => '管理费',
-        ];
-    }
-}

+ 0 - 73
common/models/CalcBonusLS.php

@@ -1,73 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_LS}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $FROM_USER_ID 来源会员ID
- * @property string $FROM_DEC_SN 来源报单编号
- * @property string $AMOUNT 奖金金额
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_YEAR 所在结算年
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_CALC_MONTH 表分区的日期索引
- * @property string $LOGS 日志
- * @property int $CREATED_AT 创建时间
- */
-class CalcBonusLS extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_LS}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'FROM_USER_ID', 'FROM_DEC_SN', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT'], 'number'],
-            [['LAST_STATUS', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'FROM_USER_ID', 'FROM_DEC_SN', 'LAST_DEC_LV', 'LAST_EMP_LV'], 'string', 'max' => 32],
-            [['P_CALC_MONTH'], 'safe'],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'FROM_USER_ID' => '来源会员ID',
-            'FROM_DEC_SN' => '来源报单编号',
-            'AMOUNT' => '奖金金额',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_YEAR' => '所在结算年',
-            'CALC_MONTH' => '所在结算月',
-            'P_CALC_MONTH' => '表分区的日期索引',
-            'LOGS' => '日志',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}

+ 0 - 73
common/models/CalcBonusLX.php

@@ -1,73 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_LX}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $FROM_USER_ID 来源会员ID
- * @property string $FROM_DEC_SN 来源报单编号
- * @property string $AMOUNT 奖金金额
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_YEAR 所在结算年
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_CALC_MONTH 表分区的日期索引
- * @property string $LOGS 日志
- * @property int $CREATED_AT 创建时间
- */
-class CalcBonusLX extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_LX}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'FROM_USER_ID', 'FROM_DEC_SN', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT'], 'number'],
-            [['LAST_STATUS', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'FROM_USER_ID', 'FROM_DEC_SN', 'LAST_DEC_LV', 'LAST_EMP_LV'], 'string', 'max' => 32],
-            [['P_CALC_MONTH'], 'safe'],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'FROM_USER_ID' => '来源会员ID',
-            'FROM_DEC_SN' => '来源报单编号',
-            'AMOUNT' => '奖金金额',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_YEAR' => '所在结算年',
-            'CALC_MONTH' => '所在结算月',
-            'P_CALC_MONTH' => '表分区的日期索引',
-            'LOGS' => '日志',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}

+ 0 - 83
common/models/CalcBonusStandard.php

@@ -1,83 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_STANDARD}}".
- *
- * @property string $ID
- * @property string $USER_ID
- * @property string $LAST_DEC_LV
- * @property string $LAST_EMP_LV
- * @property int $LAST_STATUS
- * @property string $FROM_USER_ID
- * @property string $LAST_FROM_DEC_LV
- * @property string $LAST_FROM_EMP_LV
- * @property int $LAST_FROM_STATUS
- * @property string $AMOUNT
- * @property int $PERIOD_NUM
- * @property int $CALC_YEAR
- * @property int $CALC_MONTH
- * @property string $P_CALC_MONTH
- * @property string $LOGS
- * @property int $CREATED_AT
- * @property string $ORI_BONUS
- * @property string $RECONSUME_POINTS
- * @property string $MANAGE_TAX
- */
-class CalcBonusStandard extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_STANDARD}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ID', 'USER_ID', 'FROM_USER_ID', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['LAST_STATUS', 'LAST_FROM_STATUS', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['AMOUNT', 'ORI_BONUS', 'RECONSUME_POINTS', 'MANAGE_TAX'], 'number'],
-            [['P_CALC_MONTH'], 'safe'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'FROM_USER_ID', 'LAST_FROM_DEC_LV', 'LAST_FROM_EMP_LV'], 'string', 'max' => 32],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => 'User  ID',
-            'LAST_DEC_LV' => 'Last  Dec  Lv',
-            'LAST_EMP_LV' => 'Last  Emp  Lv',
-            'LAST_STATUS' => 'Last  Status',
-            'FROM_USER_ID' => 'From  User  ID',
-            'LAST_FROM_DEC_LV' => 'Last  From  Dec  Lv',
-            'LAST_FROM_EMP_LV' => 'Last  From  Emp  Lv',
-            'LAST_FROM_STATUS' => 'Last  From  Status',
-            'AMOUNT' => 'Amount',
-            'PERIOD_NUM' => 'Period  Num',
-            'CALC_YEAR' => 'Calc  Year',
-            'CALC_MONTH' => 'Calc  Month',
-            'P_CALC_MONTH' => 'P  Calc  Month',
-            'LOGS' => 'Logs',
-            'CREATED_AT' => 'Created  At',
-            'ORI_BONUS' => 'Ori  Bonus',
-            'RECONSUME_POINTS' => 'Reconsume  Points',
-            'MANAGE_TAX' => 'Manage  Tax',
-        ];
-    }
-}

+ 0 - 80
common/models/CalcBonusVIP.php

@@ -1,80 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_VIP}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $FROM_USER_ID 来源会员ID
- * @property string $LAST_FROM_DEC_LV 结算时来源会员级别
- * @property string $LAST_FROM_EMP_LV 结算时来源会员聘级
- * @property int $LAST_FROM_STATUS 结算时来源状态
- * @property string $AMOUNT 金额
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_MONTH 所在结算月
- * @property int $CALCULATED_AT 结算时间
- * @property int $CREATED_AT 创建时间
- * @property string $LOGS 日志
- * @property $ORI_BONUS 原奖金
- * @property $RECONSUME_POINTS 重复消费积分
- * @property $MANAGE_TAX 管理费
- */
-class CalcBonusVIP extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_VIP}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'PERIOD_NUM', 'CALC_MONTH', 'CALCULATED_AT', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'ORI_BONUS', 'RECONSUME_POINTS', 'MANAGE_TAX'], 'number'],
-            [['LAST_STATUS', 'PERIOD_NUM', 'CALC_MONTH', 'CALCULATED_AT', 'CREATED_AT', 'LAST_FROM_STATUS'], 'integer'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'FROM_USER_ID',  'LAST_FROM_DEC_LV', 'LAST_FROM_EMP_LV'], 'string', 'max' => 32],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'FROM_USER_ID' => '来源会员ID',
-            'LAST_FROM_DEC_LV' => '结算时来源会员级别',
-            'LAST_FROM_EMP_LV' => '结算时来源会员聘级',
-            'LAST_FROM_STATUS' => '结算时来源状态',
-            'AMOUNT' => '金额',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_MONTH' => '所在结算月',
-            'CALCULATED_AT' => '结算时间',
-            'CREATED_AT' => '创建时间',
-            'LOGS' => '日志',
-            'ORI_BONUS' => '原奖金',
-            'RECONSUME_POINTS' => '重复消费积分',
-            'MANAGE_TAX' => '管理费',
-        ];
-    }
-}

+ 0 - 80
common/models/CalcBonusXF.php

@@ -1,80 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_XF}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $FROM_USER_ID 来源会员ID
- * @property string $LAST_FROM_DEC_LV 结算时来源会员级别
- * @property string $LAST_FROM_EMP_LV 结算时来源会员聘级
- * @property int $LAST_FROM_STATUS 结算时来源状态
- * @property string $AMOUNT 金额
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_MONTH 所在结算月
- * @property int $CALCULATED_AT 结算时间
- * @property int $CREATED_AT 创建时间
- * @property string $LOGS 日志
- * @property $ORI_BONUS 原奖金
- * @property $RECONSUME_POINTS 重复消费积分
- * @property $MANAGE_TAX 管理费
- */
-class CalcBonusXF extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_XF}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'PERIOD_NUM', 'CALC_MONTH', 'CALCULATED_AT', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'ORI_BONUS', 'RECONSUME_POINTS', 'MANAGE_TAX'], 'number'],
-            [['LAST_STATUS', 'PERIOD_NUM', 'CALC_MONTH', 'CALCULATED_AT', 'CREATED_AT', 'LAST_FROM_STATUS'], 'integer'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'FROM_USER_ID',  'LAST_FROM_DEC_LV', 'LAST_FROM_EMP_LV'], 'string', 'max' => 32],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'FROM_USER_ID' => '来源会员ID',
-            'LAST_FROM_DEC_LV' => '结算时来源会员级别',
-            'LAST_FROM_EMP_LV' => '结算时来源会员聘级',
-            'LAST_FROM_STATUS' => '结算时来源状态',
-            'AMOUNT' => '金额',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_MONTH' => '所在结算月',
-            'CALCULATED_AT' => '结算时间',
-            'CREATED_AT' => '创建时间',
-            'LOGS' => '日志',
-            'ORI_BONUS' => '原奖金',
-            'RECONSUME_POINTS' => '重复消费积分',
-            'MANAGE_TAX' => '管理费',
-        ];
-    }
-}

+ 0 - 97
common/models/CalcBonusYC.php

@@ -1,97 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_YC}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $FROM_USER_ID 来源会员ID
- * @property string $LAST_FROM_DEC_LV 结算时来源会员级别
- * @property string $LAST_FROM_EMP_LV 结算时来源会员聘级
- * @property int $LAST_FROM_STATUS 结算时来源状态
- * @property string $FROM_DEC_SN 来源报单编号
- * @property string $AMOUNT 奖金金额
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_YEAR 所在结算年
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_CALC_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- * @property string $LOGS 日志
- * @property $ORI_BONUS 原奖金
- * @property $RECONSUME_POINTS 重复消费积分
- * @property $MANAGE_TAX 管理费
- * @property $BONUS_TYPE 奖金类型
- */
-class CalcBonusYC extends \common\components\ActiveRecord
-{
-    const BONUS_TYPE_YC = 0;
-    const BONUS_TYPE_LEVEL_YC_ONE = 1;
-    const BONUS_TYPE_LEVEL_YC_TWO = 2;
-
-    const BONUS_TYPE_NAME = [
-        '普通荣衔',
-        '平级一代',
-        '平级二代',
-    ];
-
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_YC}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'FROM_USER_ID', 'FROM_DEC_SN', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'ORI_BONUS', 'RECONSUME_POINTS', 'MANAGE_TAX'], 'number'],
-            [['LAST_STATUS', 'LAST_FROM_STATUS', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CREATED_AT', 'BONUS_TYPE'], 'integer'],
-            [['ID', 'USER_ID', 'FROM_USER_ID', 'FROM_DEC_SN', 'LAST_DEC_LV', 'LAST_FROM_DEC_LV', 'LAST_FROM_EMP_LV'], 'string', 'max' => 32],
-            [['P_CALC_MONTH'], 'safe'],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'FROM_USER_ID' => '来源会员ID',
-            'LAST_FROM_DEC_LV' => '结算时来源会员级别',
-            'LAST_FROM_EMP_LV' => '结算时来源会员聘级',
-            'LAST_FROM_STATUS' => '结算时来源状态',
-            'FROM_DEC_SN' => '来源报单编号',
-            'AMOUNT' => '奖金金额',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_YEAR' => '所在结算年',
-            'CALC_MONTH' => '所在结算月',
-            'P_CALC_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-            'LOGS' => '日志',
-            'ORI_BONUS' => '原奖金',
-            'RECONSUME_POINTS' => '重复消费积分',
-            'MANAGE_TAX' => '管理费',
-            'BONUS_TYPE' => '奖金类型',
-        ];
-    }
-}

+ 0 - 80
common/models/CalcBonusYJ.php

@@ -1,80 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_BONUS_YJ}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时状态
- * @property string $FROM_USER_ID 来源会员ID
- * @property string $LAST_FROM_DEC_LV 结算时来源会员级别
- * @property string $LAST_FROM_EMP_LV 结算时来源会员聘级
- * @property int $LAST_FROM_STATUS 结算时来源状态
- * @property string $AMOUNT 金额
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_MONTH 所在结算月
- * @property int $CALCULATED_AT 结算时间
- * @property int $CREATED_AT 创建时间
- * @property string $LOGS 日志
- * @property $ORI_BONUS 原奖金
- * @property $RECONSUME_POINTS 重复消费积分
- * @property $MANAGE_TAX 管理费
- */
-class CalcBonusYJ extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_BONUS_YJ}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'PERIOD_NUM', 'CALC_MONTH', 'CALCULATED_AT', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'ORI_BONUS', 'RECONSUME_POINTS', 'MANAGE_TAX'], 'number'],
-            [['LAST_STATUS', 'PERIOD_NUM', 'CALC_MONTH', 'CALCULATED_AT', 'CREATED_AT', 'LAST_FROM_STATUS'], 'integer'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV', 'FROM_USER_ID',  'LAST_FROM_DEC_LV', 'LAST_FROM_EMP_LV'], 'string', 'max' => 32],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时状态',
-            'FROM_USER_ID' => '来源会员ID',
-            'LAST_FROM_DEC_LV' => '结算时来源会员级别',
-            'LAST_FROM_EMP_LV' => '结算时来源会员聘级',
-            'LAST_FROM_STATUS' => '结算时来源状态',
-            'AMOUNT' => '金额',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_MONTH' => '所在结算月',
-            'CALCULATED_AT' => '结算时间',
-            'CREATED_AT' => '创建时间',
-            'LOGS' => '日志',
-            'ORI_BONUS' => '原奖金',
-            'RECONSUME_POINTS' => '重复消费积分',
-            'MANAGE_TAX' => '管理费',
-        ];
-    }
-}

+ 0 - 51
common/models/CalcMonthBonusUser.php

@@ -1,51 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%CALC_MONTH_BONUS_USER}}".
- *
- * @property string $ID
- * @property string $USER_ID 用户ID
- * @property int $CALC_MONTH 结算月
- * @property int $CREATED_AT 创建时间
- */
-class CalcMonthBonusUser extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%CALC_MONTH_BONUS_USER}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ID', 'USER_ID', 'CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['ID', 'USER_ID'], 'string', 'max' => 32],
-            [['CALC_MONTH', 'USER_ID'], 'unique', 'targetAttribute' => ['CALC_MONTH', 'USER_ID']],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '用户ID',
-            'CALC_MONTH' => '结算月',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}

+ 0 - 72
common/models/CompanyBank.php

@@ -1,72 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%COMPANY_BANK}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $OPEN_NAME 开户名
- * @property string $OPEN_BANK 开户行
- * @property string $BANK_ADDRESS 银行地址
- * @property string $BANK_NO 银行账号
- * @property string $CREATE_ADMIN 创建管理员
- * @property string $UPDATE_ADMIN 修改管理员
- * @property string $REMARK 备注
- * @property int $BANK_PROVINCE 银行省份
- * @property int $BANK_CITY 银行城市
- * @property int $BANK_COUNTY 银行地区
- * @property int $CREATED_AT 创建时间
- * @property int $UPDATED_AT 修改时间
- */
-class CompanyBank extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%COMPANY_BANK}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'OPEN_NAME', 'OPEN_BANK', 'BANK_ADDRESS', 'BANK_NO', 'BANK_PROVINCE', 'BANK_CITY', 'BANK_COUNTY', 'CREATED_AT'], 'required'],
-            [['BANK_PROVINCE', 'BANK_CITY', 'BANK_COUNTY', 'CREATED_AT', 'UPDATED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'BANK_NO', 'CREATE_ADMIN', 'UPDATE_ADMIN'], 'string', 'max' => 32],
-            [['OPEN_NAME', 'OPEN_BANK', 'BANK_ADDRESS'], 'string', 'max' => 255],
-            [['REMARK'], 'string', 'max' => 4000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'OPEN_NAME' => '开户名',
-            'OPEN_BANK' => '开户行',
-            'BANK_ADDRESS' => '银行地址',
-            'BANK_NO' => '银行账号',
-            'BANK_PROVINCE' => '银行省份',
-            'BANK_CITY' => '银行城市',
-            'BANK_COUNTY' => '银行地区',
-            'CREATE_ADMIN' => '创建管理员',
-            'UPDATE_ADMIN' => '修改管理员',
-            'REMARK' => '备注',
-            'CREATED_AT' => '创建时间',
-            'UPDATED_AT' => '修改时间',
-        ];
-    }
-}

+ 0 - 50
common/models/DeductReconsume.php

@@ -1,50 +0,0 @@
-<?php
-
-namespace common\models;
-
-/**
- * This is the model class for table "{{%DEDUCT_RECONSUME}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property int $RECONSUME_POINTS_SUM 结算月累计复消积分之和
- * @property int $CALC_MONTH 变动的结算月
- * @property int $CREATED_AT 创建时间
- */
-class DeductReconsume extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%DEDUCT_RECONSUME}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ID', 'USER_ID', 'CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['ID', 'USER_ID'], 'string', 'max' => 32],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'CALC_MONTH' => '变动的结算月',
-            'RECONSUME_POINTS_SUM' => '此结算月累计复消积分总和',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}

+ 0 - 93
common/models/FlowBonus.php

@@ -1,93 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%FLOW_BONUS}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 记录时会员级别
- * @property string $LAST_EMP_LV 记录时会员聘级
- * @property int $LAST_STATUS 记录时状态
- * @property string $CALC_ID 奖金结算表ID
- * @property string $AMOUNT 金额
- * @property string $TOTAL 当前总金额
- * @property int $IS_INCR 是否增加
- * @property string $REMARK 备注
- * @property int $REMARK_IS_SHOW 备注是否显示
- * @property string $DEAL_TYPE_ID 交易类型名称
- * @property int $DEAL_TYPE_IS_PRESET 交易类型是否预置
- * @property string $ADMIN_NAME 操作人名称
- * @property int $PERIOD_NUM 所在期数
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- * @property int $DELETED 是否删除
- * @property int $DELETED_AT 删除时间
- * @property string $TRANSFER_SN 转账流水号
- * @property int $SORT 排序
- */
-class FlowBonus extends \common\components\ActiveRecord
-{
-    const INCR_REDUCE = 0;      // 减少
-    const INCR_ADD = 1;         // 增加
-    const INCR_FREEZE = 2;      // 冻结
-    const INCR_UNFREEZE = 3;    // 解冻
-
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%FLOW_BONUS}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'P_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'TOTAL'], 'number'],
-            [['LAST_STATUS', 'IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'REMARK_IS_SHOW', 'DELETED', 'DELETED_AT', 'DEAL_TYPE_IS_PRESET', 'SORT'], 'integer'],
-            [['ID', 'USER_ID', 'CALC_ID', 'ADMIN_NAME', 'LAST_DEC_LV', 'LAST_EMP_LV', 'DEAL_TYPE_ID', 'TRANSFER_SN'], 'string', 'max' => 32],
-            [['REMARK'], 'string', 'max' => 255],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '记录时会员级别',
-            'LAST_EMP_LV' => '记录时会员聘级',
-            'LAST_STATUS' => '记录时状态',
-            'CALC_ID' => '奖金结算表ID',
-            'AMOUNT' => '金额',
-            'TOTAL' => '当前总金额',
-            'IS_INCR' => '是否增加',
-            'REMARK' => '备注',
-            'REMARK_IS_SHOW' => '备注是否显示',
-            'DEAL_TYPE_ID' => '交易类型ID',
-            'DEAL_TYPE_IS_PRESET' => '交易类型是否预置',
-            'ADMIN_NAME' => '操作人名称',
-            'PERIOD_NUM' => '所在期数',
-            'CALC_MONTH' => '所在结算月',
-            'P_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-            'DELETED' => '是否删除',
-            'DELETED_AT' => '删除时间',
-            'TRANSFER_SN' => '转账流水号',
-            'SORT' => '排序',
-        ];
-    }
-}

+ 0 - 82
common/models/FlowCF.php

@@ -1,82 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%FLOW_CF}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 记录时会员级别
- * @property string $LAST_EMP_LV 记录时会员聘级
- * @property int $LAST_STATUS 记录时状态
- * @property string $AMOUNT 金额
- * @property string $TOTAL 当前总金额
- * @property int $IS_INCR 是否增加
- * @property string $REMARK 备注
- * @property int $REMARK_IS_SHOW 备注是否显示
- * @property string $DEAL_TYPE_ID 交易类型名称
- * @property int $DEAL_TYPE_IS_PRESET 交易类型是否预置
- * @property string $ADMIN_NAME 操作人名称
- * @property int $PERIOD_NUM 所在期数
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- * @property int $DELETED 是否删除
- * @property int $DELETED_AT 删除时间
- */
-class FlowCF extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%FLOW_CF}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'P_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'TOTAL'], 'number'],
-            [['LAST_STATUS', 'IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'REMARK_IS_SHOW', 'DELETED', 'DELETED_AT', 'DEAL_TYPE_IS_PRESET'], 'integer'],
-            [['ID', 'USER_ID', 'ADMIN_NAME', 'LAST_DEC_LV', 'LAST_EMP_LV', 'DEAL_TYPE_ID'], 'string', 'max' => 32],
-            [['REMARK'], 'string', 'max' => 255],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '记录时会员级别',
-            'LAST_EMP_LV' => '记录时会员聘级',
-            'LAST_STATUS' => '记录时状态',
-            'AMOUNT' => '金额',
-            'TOTAL' => '当前总金额',
-            'IS_INCR' => '是否增加',
-            'REMARK' => '备注',
-            'REMARK_IS_SHOW' => '备注是否显示',
-            'DEAL_TYPE_ID' => '交易类型ID',
-            'DEAL_TYPE_IS_PRESET' => '交易类型是否预置',
-            'ADMIN_NAME' => '操作人名称',
-            'PERIOD_NUM' => '所在期数',
-            'CALC_MONTH' => '所在结算月',
-            'P_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-            'DELETED' => '是否删除',
-            'DELETED_AT' => '删除时间',
-        ];
-    }
-}

+ 0 - 71
common/models/FlowDeductZR.php

@@ -1,71 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%FLOW_DEDUCT_ZR}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 记录时会员级别
- * @property string $LAST_EMP_LV 记录时会员聘级
- * @property int $LAST_STATUS 记录时状态
- * @property string $ZR 责任业绩
- * @property string $LOGS 日志
- * @property string $SURPLUS_BONUS 剩余奖金
- * @property int $PERIOD_NUM 结算期数
- * @property int $CALC_YEAR 所在结算年
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_CALC_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- */
-class FlowDeductZR extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%FLOW_DEDUCT_ZR}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['ZR', 'SURPLUS_BONUS'], 'number'],
-            [['LAST_STATUS', 'PERIOD_NUM', 'CALC_YEAR', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV'], 'string', 'max' => 32],
-            [['LOGS'], 'string', 'max' => 2000],
-            [['P_CALC_MONTH'], 'safe'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '记录时会员级别',
-            'LAST_EMP_LV' => '记录时会员聘级',
-            'LAST_STATUS' => '记录时状态',
-            'ZR' => '责任业绩',
-            'LOGS' => '日志',
-            'SURPLUS_BONUS' => '剩余奖金',
-            'PERIOD_NUM' => '结算期数',
-            'CALC_YEAR' => '所在结算年',
-            'CALC_MONTH' => '所在结算月',
-            'P_CALC_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}

+ 0 - 83
common/models/FlowExchangePoints.php

@@ -1,83 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%FLOW_RECONSUME_POINTS}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 记录时会员级别
- * @property string $LAST_EMP_LV 记录时会员聘级
- * @property int $LAST_STATUS 记录时状态
- * @property string $AMOUNT 金额
- * @property string $AMOUNT_STANDARD 标准金额
- * @property string $TOTAL 当前总金额
- * @property int $IS_INCR 是否增加
- * @property string $REMARK 备注
- * @property int $REMARK_IS_SHOW 备注是否显示
- * @property string $DEAL_TYPE_ID 交易类型名称
- * @property int $DEAL_TYPE_IS_PRESET 交易类型是否预置
- * @property string $ADMIN_NAME 操作人名称
- * @property int $PERIOD_NUM 所在期数
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- * @property int $DELETED 是否删除
- * @property int $DELETED_AT 删除时间
- */
-class FlowExchangePoints extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%FLOW_EXCHANGE_POINTS}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'P_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'TOTAL', 'AMOUNT_STANDARD'], 'number'],
-            [['LAST_STATUS', 'IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'REMARK_IS_SHOW', 'DELETED', 'DELETED_AT', 'DEAL_TYPE_IS_PRESET'], 'integer'],
-            [['ID', 'USER_ID', 'ADMIN_NAME', 'LAST_DEC_LV', 'LAST_EMP_LV', 'DEAL_TYPE_ID'], 'string', 'max' => 32],
-            [['REMARK'], 'string', 'max' => 255],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '记录时会员级别',
-            'LAST_EMP_LV' => '记录时会员聘级',
-            'LAST_STATUS' => '记录时状态',
-            'AMOUNT' => '金额',
-            'TOTAL' => '当前总金额',
-            'IS_INCR' => '是否增加',
-            'REMARK' => '备注',
-            'REMARK_IS_SHOW' => '备注是否显示',
-            'DEAL_TYPE_ID' => '交易类型ID',
-            'DEAL_TYPE_IS_PRESET' => '交易类型是否预置',
-            'ADMIN_NAME' => '操作人名称',
-            'PERIOD_NUM' => '所在期数',
-            'CALC_MONTH' => '所在结算月',
-            'P_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-            'DELETED' => '是否删除',
-            'DELETED_AT' => '删除时间',
-        ];
-    }
-}

+ 0 - 81
common/models/FlowGaragePoints.php

@@ -1,81 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%FLOW_GARAGE_POINTS}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $CALC_ID 奖金结算表ID
- * @property string $AMOUNT 金额
- * @property string $TOTAL 当前总金额
- * @property int $IS_INCR 是否增加
- * @property string $REMARK 备注
- * @property string $ADMIN_NAME 操作人名称
- * @property int $PERIOD_NUM 所在期数
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- * @property int $DELETED 是否删除
- * @property int $DELETED_AT 删除时间
- * @property int $SORT 排序
- * @property string $TRANSFER_SN 转账流水号
- */
-class FlowGaragePoints extends \common\components\ActiveRecord
-{
-    const INCR_REDUCE = 0;      // 减少
-    const INCR_ADD = 1;         // 增加
-    const INCR_FREEZE = 2;      // 冻结
-    const INCR_UNFREEZE = 3;    // 解冻
-
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%FLOW_GARAGE_POINTS}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'P_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'TOTAL'], 'number'],
-            [['IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'DELETED', 'DELETED_AT', 'SORT'], 'integer'],
-            [['ID', 'USER_ID', 'CALC_ID', 'ADMIN_NAME', 'TRANSFER_SN', 'LAST_CROWN_LV'], 'string', 'max' => 32],
-            [['REMARK'], 'string', 'max' => 255],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'CALC_ID' => '结算表ID',
-            'AMOUNT' => '交易金额',
-            'TOTAL' => '当前总金额',
-            'IS_INCR' => '是否增加',
-            'REMARK' => '备注',
-            'ADMIN_NAME' => '操作人名称',
-            'PERIOD_NUM' => '所在期数',
-            'CALC_MONTH' => '所在结算月',
-            'P_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-            'DELETED' => '是否删除',
-            'DELETED_AT' => '删除时间',
-            'SORT' => '排序',
-            'TRANSFER_SN' => '转账流水号',
-        ];
-    }
-}

+ 0 - 82
common/models/FlowLX.php

@@ -1,82 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%FLOW_LX}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 记录时会员级别
- * @property string $LAST_EMP_LV 记录时会员聘级
- * @property int $LAST_STATUS 记录时状态
- * @property string $AMOUNT 金额
- * @property string $TOTAL 当前总金额
- * @property int $IS_INCR 是否增加
- * @property string $REMARK 备注
- * @property int $REMARK_IS_SHOW 备注是否显示
- * @property string $DEAL_TYPE_ID 交易类型名称
- * @property int $DEAL_TYPE_IS_PRESET 交易类型是否预置
- * @property string $ADMIN_NAME 操作人名称
- * @property int $PERIOD_NUM 所在期数
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- * @property int $DELETED 是否删除
- * @property int $DELETED_AT 删除时间
- */
-class FlowLX extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%FLOW_LX}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'P_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'TOTAL'], 'number'],
-            [['LAST_STATUS', 'IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'REMARK_IS_SHOW', 'DELETED', 'DELETED_AT', 'DEAL_TYPE_IS_PRESET'], 'integer'],
-            [['ID', 'USER_ID', 'ADMIN_NAME', 'LAST_DEC_LV', 'LAST_EMP_LV', 'DEAL_TYPE_ID'], 'string', 'max' => 32],
-            [['REMARK'], 'string', 'max' => 255],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '记录时会员级别',
-            'LAST_EMP_LV' => '记录时会员聘级',
-            'LAST_STATUS' => '记录时状态',
-            'AMOUNT' => '金额',
-            'TOTAL' => '当前总金额',
-            'IS_INCR' => '是否增加',
-            'REMARK' => '备注',
-            'REMARK_IS_SHOW' => '备注是否显示',
-            'DEAL_TYPE_ID' => '交易类型ID',
-            'DEAL_TYPE_IS_PRESET' => '交易类型是否预置',
-            'ADMIN_NAME' => '操作人名称',
-            'PERIOD_NUM' => '所在期数',
-            'CALC_MONTH' => '所在结算月',
-            'P_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-            'DELETED' => '是否删除',
-            'DELETED_AT' => '删除时间',
-        ];
-    }
-}

+ 0 - 82
common/models/FlowReconsumePoints.php

@@ -1,82 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%FLOW_RECONSUME_POINTS}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 记录时会员级别
- * @property string $LAST_EMP_LV 记录时会员聘级
- * @property int $LAST_STATUS 记录时状态
- * @property string $AMOUNT 金额
- * @property string $TOTAL 当前总金额
- * @property int $IS_INCR 是否增加
- * @property string $REMARK 备注
- * @property int $REMARK_IS_SHOW 备注是否显示
- * @property string $DEAL_TYPE_ID 交易类型名称
- * @property int $DEAL_TYPE_IS_PRESET 交易类型是否预置
- * @property string $ADMIN_NAME 操作人名称
- * @property int $PERIOD_NUM 所在期数
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- * @property int $DELETED 是否删除
- * @property int $DELETED_AT 删除时间
- */
-class FlowReconsumePoints extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%FLOW_RECONSUME_POINTS}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'P_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'TOTAL'], 'number'],
-            [['LAST_STATUS', 'IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'REMARK_IS_SHOW', 'DELETED', 'DELETED_AT', 'DEAL_TYPE_IS_PRESET'], 'integer'],
-            [['ID', 'USER_ID', 'ADMIN_NAME', 'LAST_DEC_LV', 'LAST_EMP_LV', 'DEAL_TYPE_ID'], 'string', 'max' => 32],
-            [['REMARK'], 'string', 'max' => 255],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '记录时会员级别',
-            'LAST_EMP_LV' => '记录时会员聘级',
-            'LAST_STATUS' => '记录时状态',
-            'AMOUNT' => '金额',
-            'TOTAL' => '当前总金额',
-            'IS_INCR' => '是否增加',
-            'REMARK' => '备注',
-            'REMARK_IS_SHOW' => '备注是否显示',
-            'DEAL_TYPE_ID' => '交易类型ID',
-            'DEAL_TYPE_IS_PRESET' => '交易类型是否预置',
-            'ADMIN_NAME' => '操作人名称',
-            'PERIOD_NUM' => '所在期数',
-            'CALC_MONTH' => '所在结算月',
-            'P_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-            'DELETED' => '是否删除',
-            'DELETED_AT' => '删除时间',
-        ];
-    }
-}

+ 0 - 25
common/models/FlowRemainPv.php

@@ -1,25 +0,0 @@
-<?php
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%FLOW_REMAIN_PV}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property int $REMAIN_PV_FLOW 剩余BV FLOW
- * @property int $UPDATED_AT 更新时间
- * @property varchar $ORDER_SN 订单SN号
- */
-class FlowRemainPv extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%FLOW_REMAIN_PV}}';
-    }
-
-}

+ 0 - 81
common/models/FlowTourismPoints.php

@@ -1,81 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%FLOW_TOURISM_POINTS}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $CALC_ID 奖金结算表ID
- * @property string $AMOUNT 金额
- * @property string $TOTAL 当前总金额
- * @property int $IS_INCR 是否增加
- * @property string $REMARK 备注
- * @property string $ADMIN_NAME 操作人名称
- * @property int $PERIOD_NUM 所在期数
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- * @property int $DELETED 是否删除
- * @property int $DELETED_AT 删除时间
- * @property int $SORT 排序
- * @property string $TRANSFER_SN 转账流水号
- */
-class FlowTourismPoints extends \common\components\ActiveRecord
-{
-    const INCR_REDUCE = 0;      // 减少
-    const INCR_ADD = 1;         // 增加
-    const INCR_FREEZE = 2;      // 冻结
-    const INCR_UNFREEZE = 3;    // 解冻
-
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%FLOW_TOURISM_POINTS}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'P_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'TOTAL'], 'number'],
-            [['IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'DELETED', 'DELETED_AT', 'SORT'], 'integer'],
-            [['ID', 'USER_ID', 'CALC_ID', 'ADMIN_NAME', 'TRANSFER_SN', 'LAST_CROWN_LV'], 'string', 'max' => 32],
-            [['REMARK'], 'string', 'max' => 255],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'CALC_ID' => '结算表ID',
-            'AMOUNT' => '交易金额',
-            'TOTAL' => '当前总金额',
-            'IS_INCR' => '是否增加',
-            'REMARK' => '备注',
-            'ADMIN_NAME' => '操作人名称',
-            'PERIOD_NUM' => '所在期数',
-            'CALC_MONTH' => '所在结算月',
-            'P_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-            'DELETED' => '是否删除',
-            'DELETED_AT' => '删除时间',
-            'SORT' => '排序',
-            'TRANSFER_SN' => '转账流水号',
-        ];
-    }
-}

+ 0 - 81
common/models/FlowVillaPoints.php

@@ -1,81 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%FLOW_VILLA_POINTS}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $CALC_ID 奖金结算表ID
- * @property string $AMOUNT 金额
- * @property string $TOTAL 当前总金额
- * @property int $IS_INCR 是否增加
- * @property string $REMARK 备注
- * @property string $ADMIN_NAME 操作人名称
- * @property int $PERIOD_NUM 所在期数
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- * @property int $DELETED 是否删除
- * @property int $DELETED_AT 删除时间
- * @property int $SORT 排序
- * @property string $TRANSFER_SN 转账流水号
- */
-class FlowVillaPoints extends \common\components\ActiveRecord
-{
-    const INCR_REDUCE = 0;      // 减少
-    const INCR_ADD = 1;         // 增加
-    const INCR_FREEZE = 2;      // 冻结
-    const INCR_UNFREEZE = 3;    // 解冻
-
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%FLOW_VILLA_POINTS}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'P_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'TOTAL'], 'number'],
-            [['IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'DELETED', 'DELETED_AT', 'SORT'], 'integer'],
-            [['ID', 'USER_ID', 'CALC_ID', 'ADMIN_NAME', 'TRANSFER_SN', 'LAST_CROWN_LV'], 'string', 'max' => 32],
-            [['REMARK'], 'string', 'max' => 255],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'CALC_ID' => '结算表ID',
-            'AMOUNT' => '交易金额',
-            'TOTAL' => '当前总金额',
-            'IS_INCR' => '是否增加',
-            'REMARK' => '备注',
-            'ADMIN_NAME' => '操作人名称',
-            'PERIOD_NUM' => '所在期数',
-            'CALC_MONTH' => '所在结算月',
-            'P_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-            'DELETED' => '是否删除',
-            'DELETED_AT' => '删除时间',
-            'SORT' => '排序',
-            'TRANSFER_SN' => '转账流水号',
-        ];
-    }
-}

+ 0 - 81
common/models/FlowWallet.php

@@ -1,81 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%FLOW_WALLET}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $CALC_ID 奖金结算表ID
- * @property string $AMOUNT 金额
- * @property string $TOTAL 当前总金额
- * @property int $IS_INCR 是否增加
- * @property string $REMARK 备注
- * @property string $ADMIN_NAME 操作人名称
- * @property int $PERIOD_NUM 所在期数
- * @property int $CALC_MONTH 所在结算月
- * @property string $P_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- * @property int $DELETED 是否删除
- * @property int $DELETED_AT 删除时间
- * @property int $SORT 排序
- * @property string $TRANSFER_SN 转账流水号
- */
-class FlowWallet extends \common\components\ActiveRecord
-{
-    const INCR_REDUCE = 0;      // 减少
-    const INCR_ADD = 1;         // 增加
-    const INCR_FREEZE = 2;      // 冻结
-    const INCR_UNFREEZE = 3;    // 解冻
-
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%FLOW_WALLET}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'P_MONTH', 'CREATED_AT'], 'required'],
-            [['AMOUNT', 'TOTAL'], 'number'],
-            [['IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'DELETED', 'DELETED_AT', 'SORT'], 'integer'],
-            [['ID', 'USER_ID', 'CALC_ID', 'ADMIN_NAME', 'TRANSFER_SN'], 'string', 'max' => 32],
-            [['REMARK'], 'string', 'max' => 255],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'CALC_ID' => '现金结算表ID',
-            'AMOUNT' => '金额',
-            'TOTAL' => '当前总金额',
-            'IS_INCR' => '是否增加',
-            'REMARK' => '备注',
-            'ADMIN_NAME' => '操作人名称',
-            'PERIOD_NUM' => '所在期数',
-            'CALC_MONTH' => '所在结算月',
-            'P_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-            'DELETED' => '是否删除',
-            'DELETED_AT' => '删除时间',
-            'SORT' => '排序',
-            'TRANSFER_SN' => '转账流水号',
-        ];
-    }
-}

+ 0 - 111
common/models/HistoryBonus.php

@@ -1,111 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%HISTORY_BONUS}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $USER_NAME 会员编号
- * @property string $REAL_NAME 会员姓名
- * @property string $DEC_LV 会员级别
- * @property string $EMP_LV 聘级
- * @property int $IS_DEC 是否报单中心
- * @property string $DEC_ROLE_ID 报单中心级别
- * @property string $SYSTEM_NAME 体系名称
- * @property string $BONUS 奖金
- * @property string $CF 车房养老余额
- * @property string $LX 领袖分红余额
- * @property string $WITHDRAW 提现金额
- * @property string $WITHDRAW_TAX 个税
- * @property string $WITHDRAW_DEDUCT 扣款
- * @property string $WITHDRAW_REAL 实付金额
- * @property string $WITHDRAW_FAIL 实付失败金额
- * @property int $USER_STATUS 会员状态
- * @property int $USER_STATUS_AT 会员状态变更时间
- * @property string $HIGHEST_EMP_LV 历史最高聘级
- * @property string $PERIOD_AT 加入期数
- * @property string $DEC_DEC_ROLE_ID 所属报单中心级别
- * @property string $DEC_USER_NAME 所属报单中心编号
- * @property string $DEC_REAL_NAME 所属报单中心姓名
- * @property string $MOBILE 手机号
- * @property string $TEL 备用手机号码
- * @property int $PROVINCE 省份
- * @property int $CITY 城市
- * @property int $COUNTY 地区
- * @property string $SUB_COM_ID 所属分公司
- * @property int $IS_DIRECT_SELLER 是否直销员
- * @property int $BACKUP_AT 备份时间
- * @property string $PARTITION_DATE 分区日期
- */
-class HistoryBonus extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%HISTORY_BONUS}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'USER_NAME', 'REAL_NAME', 'DEC_LV', 'EMP_LV'], 'required'],
-            [['IS_DEC', 'USER_STATUS', 'USER_STATUS_AT', 'PROVINCE', 'CITY', 'COUNTY', 'IS_DIRECT_SELLER', 'BACKUP_AT'], 'integer'],
-            [['BONUS', 'CF', 'LX', 'WITHDRAW', 'WITHDRAW_TAX', 'WITHDRAW_DEDUCT', 'WITHDRAW_REAL', 'WITHDRAW_FAIL'], 'number'],
-            [['ID', 'USER_ID', 'USER_NAME', 'REAL_NAME', 'DEC_LV', 'EMP_LV', 'DEC_ROLE_ID', 'SYSTEM_NAME', 'HIGHEST_EMP_LV', 'PERIOD_AT', 'DEC_DEC_ROLE_ID', 'DEC_USER_NAME', 'DEC_REAL_NAME', 'SUB_COM_ID'], 'string', 'max' => 32],
-            [['MOBILE', 'TEL'], 'string', 'max' => 11],
-            [['PARTITION_DATE'], 'string', 'max' => 7],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'USER_NAME' => '会员编号',
-            'REAL_NAME' => '会员姓名',
-            'DEC_LV' => '会员级别',
-            'EMP_LV' => '聘级',
-            'IS_DEC' => '是否报单中心',
-            'DEC_ROLE_ID' => '报单中心级别',
-            'SYSTEM_NAME' => '体系名称',
-            'BONUS' => '奖金',
-            'CF' => '车房养老余额',
-            'LX' => '领袖分红余额',
-            'WITHDRAW' => '提现金额',
-            'WITHDRAW_TAX' => '个税',
-            'WITHDRAW_DEDUCT' => '扣款',
-            'WITHDRAW_REAL' => '实付金额',
-            'WITHDRAW_FAIL' => '实付失败金额',
-            'USER_STATUS' => '会员状态',
-            'USER_STATUS_AT' => '会员状态变更时间',
-            'HIGHEST_EMP_LV' => '历史最高聘级',
-            'PERIOD_AT' => '加入期数',
-            'DEC_DEC_ROLE_ID' => '所属报单中心级别',
-            'DEC_USER_NAME' => '所属报单中心编号',
-            'DEC_REAL_NAME' => '所属报单中心姓名',
-            'MOBILE' => '手机号',
-            'TEL' => '备用手机号码',
-            'PROVINCE' => '省份',
-            'CITY' => '城市',
-            'COUNTY' => '地区',
-            'SUB_COM_ID' => '所属分公司',
-            'IS_DIRECT_SELLER' => '是否直销员',
-            'BACKUP_AT' => '备份时间',
-            'PARTITION_DATE' => '分区日期',
-        ];
-    }
-}

+ 0 - 66
common/models/ImportScore.php

@@ -1,66 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%IMPORT_SCORE}}".
- *
- * @property string $ID ID
- * @property string $USER_ID 会员ID
- * @property string $USER_NAME 会员编号
- * @property string $REAL_NAME
- * @property string $LEVEL_NAME
- * @property string $EMP_LEVEL_NAME
- * @property string $BONUS_TOTAL
- * @property string $ORI_BONUS_TOTAL
- * @property string $BASE_SCORE 基础分数
- * @property string $LEVEL_SCORE 级别分数
- * @property string $UPGRADE_SCORE 升级分数
- * @property string $TOTAL_SCORE 总分数
- */
-class ImportScore extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%IMPORT_SCORE}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ID', 'USER_ID', 'USER_NAME', 'REAL_NAME', 'LEVEL_NAME', 'EMP_LEVEL_NAME'], 'required'],
-            [['BONUS_TOTAL', 'ORI_BONUS_TOTAL', 'BASE_SCORE', 'LEVEL_SCORE', 'UPGRADE_SCORE', 'TOTAL_SCORE'], 'number'],
-            [['ID', 'USER_ID', 'USER_NAME', 'REAL_NAME', 'LEVEL_NAME', 'EMP_LEVEL_NAME'], 'string', 'max' => 32],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'USER_NAME' => '会员编号',
-            'REAL_NAME' => 'Real  Name',
-            'LEVEL_NAME' => 'Level  Name',
-            'EMP_LEVEL_NAME' => 'Emp  Level  Name',
-            'BONUS_TOTAL' => 'Bonus  Total',
-            'ORI_BONUS_TOTAL' => 'Ori  Bonus  Total',
-            'BASE_SCORE' => '基础分数',
-            'LEVEL_SCORE' => '级别分数',
-            'UPGRADE_SCORE' => '升级分数',
-            'TOTAL_SCORE' => '总分数',
-        ];
-    }
-}

+ 0 - 87
common/models/Invoice.php

@@ -1,87 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%INVOICE}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $REAL_NAME 会员姓名
- * @property string $DEC_LV 报单级别
- * @property string $EMP_LV 聘级
- * @property string $MOBILE 手机号
- * @property string $REG_TYPE 注册类型
- * @property string $REG_NAME 注册名称
- * @property string $CREDIT_CODE 统一代码
- * @property string $SALE_NAME 销售方名称
- * @property string $TAXPAYER_NUMBER 纳税人识别代码
- * @property string $INVOICE_NUMBER 发票号
- * @property string $INVOICE_ACCOUNT 交易账户-发票账户
- * @property string $TAX_ACCOUNT 交易账户-税款账户
- * @property string $AMOUNT 交易金额
- * @property int $OUTED_AT 开票日期
- * @property int $DEDUCT_PERIOD_NUM 发票冲减期数
- * @property string $REMARK 备注
- * @property int $IS_DEL 添加时间
- * @property int $CREATED_AT 是否删除
- * @property int $DELETED_AT 删除时间
- */
-class Invoice extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%INVOICE}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'CREATED_AT'], 'required'],
-            [['AMOUNT'], 'number'],
-            [['OUTED_AT', 'DEDUCT_PERIOD_NUM', 'IS_DEL', 'CREATED_AT', 'DELETED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'DEC_LV', 'EMP_LV', 'MOBILE', 'REG_TYPE'], 'string', 'max' => 32],
-            [['REAL_NAME', 'TAXPAYER_NUMBER', 'INVOICE_NUMBER', 'INVOICE_ACCOUNT', 'TAX_ACCOUNT'], 'string', 'max' => 128],
-            [['REG_NAME', 'CREDIT_CODE', 'SALE_NAME', 'REMARK'], 'string', 'max' => 4000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'REAL_NAME' => '会员姓名',
-            'DEC_LV' => '报单级别',
-            'EMP_LV' => '聘级',
-            'MOBILE' => '手机号',
-            'REG_TYPE' => '注册类型',
-            'REG_NAME' => '注册名称',
-            'CREDIT_CODE' => '统一代码',
-            'SALE_NAME' => '销售方名称',
-            'TAXPAYER_NUMBER' => '纳税人识别代码',
-            'INVOICE_NUMBER' => '发票号',
-            'INVOICE_ACCOUNT' => '交易账户-发票账户',
-            'TAX_ACCOUNT' => '交易账户-税款账户',
-            'AMOUNT' => '交易金额',
-            'OUTED_AT' => '开票日期',
-            'DEDUCT_PERIOD_NUM' => '发票冲减期数',
-            'REMARK' => '备注',
-            'IS_DEL' => '添加时间',
-            'CREATED_AT' => '是否删除',
-            'DELETED_AT' => '删除时间',
-        ];
-    }
-}

+ 0 - 98
common/models/InvoiceAudit.php

@@ -1,98 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%INVOICE_AUDIT}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $WITHDRAW_ID 提现ID
- * @property string $INVOICE_CODE 发票代码
- * @property string $INVOICE_NUM 发票号码
- * @property string $INVOICE_DATE 开票日期
- * @property string $AMOUNT 交易金额
- * @property string $TAX_RATE 税率
- * @property string $PURCHASER_NAME 购买方名称
- * @property string $PURCHASER_REGISTER_NUM 购买方纳税人识别号
- * @property string $PURCHASER_ADDRESS 购买方地址电话
- * @property string $PURCHASER_BANK 购买方开户行及帐号
- * @property string $SELLER_NAME 销售方名称
- * @property string $SELLER_REGISTER_NUM 销售方纳税人识别号
- * @property string $SELLER_ADDRESS 销售方地址电话
- * @property string $SELLER_BANK 销售方开户行及帐号
- * @property string $ITEM_NAME 货物或应税劳务、服务名称
- * @property string $INVOICE_REMARK 发票备注
- * @property string $UPLOAD_ID 上传ID
- * @property int $AUDIT_STATUS 审核状态
- * @property string $CREATE_ADMIN 创建管理员
- * @property string $AUDIT_ADMIN 审核管理员
- * @property string $CREATE_REMARK 申请备注
- * @property string $AUDIT_REMARK 审核备注
- * @property int $CREATED_AT 创建时间
- * @property int $AUDITED_AT 审核时间
- */
-class InvoiceAudit extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%INVOICE_AUDIT}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'WITHDRAW_ID', 'INVOICE_CODE', 'INVOICE_NUM', 'INVOICE_DATE', 'PURCHASER_NAME', 'PURCHASER_REGISTER_NUM', 'PURCHASER_ADDRESS', 'PURCHASER_BANK', 'SELLER_NAME', 'SELLER_REGISTER_NUM', 'SELLER_ADDRESS', 'SELLER_BANK', 'ITEM_NAME', 'CREATED_AT'], 'required'],
-            [['AMOUNT'], 'number'],
-            [['AUDIT_STATUS', 'CREATED_AT', 'AUDITED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'WITHDRAW_ID', 'CREATE_ADMIN', 'AUDIT_ADMIN'], 'string', 'max' => 32],
-            [['INVOICE_CODE', 'INVOICE_NUM', 'INVOICE_DATE', 'PURCHASER_NAME', 'PURCHASER_REGISTER_NUM', 'PURCHASER_ADDRESS', 'PURCHASER_BANK', 'SELLER_NAME', 'SELLER_REGISTER_NUM', 'SELLER_ADDRESS', 'SELLER_BANK', 'ITEM_NAME', 'INVOICE_REMARK', 'UPLOAD_ID'], 'string', 'max' => 255],
-            [['TAX_RATE'], 'string', 'max' => 10],
-            [['CREATE_REMARK', 'AUDIT_REMARK'], 'string', 'max' => 4000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'WITHDRAW_ID' => '提现ID',
-            'INVOICE_CODE' => '发票代码',
-            'INVOICE_NUM' => '发票号码',
-            'INVOICE_DATE' => '开票日期',
-            'AMOUNT' => '交易金额',
-            'TAX_RATE' => '税率',
-            'PURCHASER_NAME' => '购买方名称',
-            'PURCHASER_REGISTER_NUM' => '购买方纳税人识别号',
-            'PURCHASER_ADDRESS' => '购买方地址电话',
-            'PURCHASER_BANK' => '购买方开户行及帐号',
-            'SELLER_NAME' => '销售方名称',
-            'SELLER_REGISTER_NUM' => '销售方纳税人识别号',
-            'SELLER_ADDRESS' => '销售方地址电话',
-            'SELLER_BANK' => '销售方开户行及帐号',
-            'ITEM_NAME' => '货物或应税劳务、服务名称',
-            'INVOICE_REMARK' => '发票备注',
-            'UPLOAD_ID' => '上传ID',
-            'AUDIT_STATUS' => '审核状态',
-            'CREATE_ADMIN' => '创建管理员',
-            'AUDIT_ADMIN' => '审核管理员',
-            'CREATE_REMARK' => '申请备注',
-            'AUDIT_REMARK' => '审核备注',
-            'CREATED_AT' => '创建时间',
-            'AUDITED_AT' => '审核时间',
-        ];
-    }
-}

+ 0 - 64
common/models/InvoiceBalanceAudit.php

@@ -1,64 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%INVOICE_BALANCE_AUDIT}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $AMOUNT 调整金额
- * @property int $AUDIT_STATUS 审核状态
- * @property string $CREATE_ADMIN 创建管理员
- * @property string $AUDIT_ADMIN 审核管理员
- * @property string $CREATE_REMARK 申请备注
- * @property string $AUDIT_REMARK 审核备注
- * @property int $CREATED_AT 创建时间
- * @property int $AUDITED_AT 审核时间
- */
-class InvoiceBalanceAudit extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%INVOICE_BALANCE_AUDIT}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'CREATE_ADMIN', 'CREATED_AT'], 'required'],
-            [['AMOUNT'], 'number'],
-            [['AUDIT_STATUS', 'CREATED_AT', 'AUDITED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'CREATE_ADMIN', 'AUDIT_ADMIN'], 'string', 'max' => 32],
-            [['CREATE_REMARK', 'AUDIT_REMARK'], 'string', 'max' => 4000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'AMOUNT' => '调整金额',
-            'AUDIT_STATUS' => '审核状态',
-            'CREATE_ADMIN' => '创建管理员',
-            'AUDIT_ADMIN' => '审核管理员',
-            'CREATE_REMARK' => '申请备注',
-            'AUDIT_REMARK' => '审核备注',
-            'CREATED_AT' => '创建时间',
-            'AUDITED_AT' => '审核时间',
-        ];
-    }
-}

+ 0 - 109
common/models/InvoiceFlow.php

@@ -1,109 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%INVOICE_FLOW}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $REAL_NAME 会员姓名
- * @property string $DEC_LV 报单级别
- * @property string $EMP_LV 聘级
- * @property string $MOBILE 手机号
- * @property string $REG_TYPE 注册类型
- * @property string $REG_NAME 注册名称
- * @property string $CREDIT_CODE 统一社会信用代码
- * @property string $SALE_NAME 销售方名称
- * @property string $TAXPAYER_NUMBER 纳税人识别号
- * @property string $INVOICE_ACCOUNT 交易账户-发票账户
- * @property string $INVOICE_SN 发票号
- * @property string $TAX_ACCOUNT 交易账户-税款账户
- * @property int $OUTED_AT 开票日期
- * @property int $DEDUCT_PERIOD_NUM 发票冲减期数
- * @property string $AMOUNT 金额
- * @property string $TOTAL 当前总金额
- * @property string $WITHDRAW_SN 提现流水号
- * @property int $IS_INCR 是否增加
- * @property string $REMARK 备注
- * @property int $PERIOD_NUM 所在期数
- * @property int $CALC_MONTH 所在结算月
- * @property string $CREATE_ADMIN 创建人
- * @property string $CREATE_REMARK 创建备注
- * @property int $CREATE_TIME 创建时间
- * @property string $AUDIT_ADMIN 审核人
- * @property string $AUDIT_REMARK 审核备注
- * @property int $AUDIT_TIME 审核时间
- * @property string $P_MONTH 表分区的日期索引
- * @property int $CREATED_AT 创建时间
- */
-class InvoiceFlow extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%INVOICE_FLOW}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'REAL_NAME', 'DEC_LV', 'EMP_LV', 'MOBILE', 'REG_TYPE', 'REG_NAME', 'CREDIT_CODE', 'REMARK', 'PERIOD_NUM', 'CALC_MONTH', 'CREATE_ADMIN', 'CREATE_TIME', 'AUDIT_ADMIN', 'AUDIT_TIME', 'P_MONTH', 'CREATED_AT'], 'required'],
-            [['OUTED_AT', 'DEDUCT_PERIOD_NUM', 'IS_INCR', 'PERIOD_NUM', 'CALC_MONTH', 'CREATE_TIME', 'AUDIT_TIME', 'CREATED_AT'], 'integer'],
-            [['AMOUNT', 'TOTAL'], 'number'],
-            [['ID', 'USER_ID', 'DEC_LV', 'EMP_LV', 'MOBILE', 'REG_TYPE', 'CREATE_ADMIN', 'AUDIT_ADMIN'], 'string', 'max' => 32],
-            [['REAL_NAME'], 'string', 'max' => 128],
-            [['REG_NAME', 'CREDIT_CODE', 'SALE_NAME', 'TAXPAYER_NUMBER', 'INVOICE_ACCOUNT', 'INVOICE_SN', 'TAX_ACCOUNT', 'WITHDRAW_SN', 'REMARK'], 'string', 'max' => 255],
-            [['CREATE_REMARK', 'AUDIT_REMARK'], 'string', 'max' => 4000],
-            [['P_MONTH'], 'string', 'max' => 7],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'REAL_NAME' => '会员姓名',
-            'DEC_LV' => '报单级别',
-            'EMP_LV' => '聘级',
-            'MOBILE' => '手机号',
-            'REG_TYPE' => '注册类型',
-            'REG_NAME' => '注册名称',
-            'CREDIT_CODE' => '统一社会信用代码',
-            'SALE_NAME' => '销售方名称',
-            'TAXPAYER_NUMBER' => '纳税人识别号',
-            'INVOICE_ACCOUNT' => '交易账户-发票账户',
-            'INVOICE_SN' => '发票号',
-            'TAX_ACCOUNT' => '交易账户-税款账户',
-            'OUTED_AT' => '开票日期',
-            'DEDUCT_PERIOD_NUM' => '发票冲减期数',
-            'AMOUNT' => '金额',
-            'TOTAL' => '当前总金额',
-            'WITHDRAW_SN' => '提现流水号',
-            'IS_INCR' => '是否增加',
-            'REMARK' => '备注',
-            'PERIOD_NUM' => '所在期数',
-            'CALC_MONTH' => '所在结算月',
-            'CREATE_ADMIN' => '创建人',
-            'CREATE_REMARK' => '创建备注',
-            'CREATE_TIME' => '创建时间',
-            'AUDIT_ADMIN' => '审核人',
-            'AUDIT_REMARK' => '审核备注',
-            'AUDIT_TIME' => '审核时间',
-            'P_MONTH' => '表分区的日期索引',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}

+ 0 - 110
common/models/Message.php

@@ -1,110 +0,0 @@
-<?php
-
-namespace common\models;
-
-use common\helpers\Date;
-use Yii;
-use yii\base\Exception;
-
-/**
- * This is the model class for table "{{%MESSAGE}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $TEXT_ID 站内信内容ID
- * @property int $IS_READ 是否已读
- * @property int $IS_DEL 是否删除
- * @property int $CREATED_AT 创建时间
- * @property int $READ_AT 已读时间
- * @property int $DELETED_AT 删除时间
- */
-class Message extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%MESSAGE}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'TEXT_ID', 'CREATED_AT'], 'required'],
-            [['IS_READ', 'IS_DEL', 'CREATED_AT', 'READ_AT', 'DELETED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'TEXT_ID'], 'string', 'max' => 32],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'TEXT_ID' => '站内信内容ID',
-            'IS_READ' => '是否已读',
-            'IS_DEL' => '是否删除',
-            'CREATED_AT' => '创建时间',
-            'READ_AT' => '已读时间',
-            'DELETED_AT' => '删除时间',
-        ];
-    }
-
-    /**
-     * 获取未读数量
-     * @param $userId
-     * @return int|string
-     */
-    public static function unreadNum($userId){
-        return static::findUseSlaves()->where('USER_ID=:USER_ID AND IS_READ=0 AND IS_DEL=0', [':USER_ID'=>$userId])->asArray()->count();
-    }
-
-    /**
-     * 抓取消息
-     * @param $userId
-     * @return bool
-     * @throws \yii\db\Exception
-     */
-    public static function pullMsgByUser($userId){
-        // 获取会员最后一次抓取信息的时间
-        $userInfo = UserInfo::findUseSlaves()->select('PULLED_AT')->where('USER_ID=:USER_ID', [':USER_ID'=>$userId])->asArray()->one();
-        if(!$userInfo){
-            return false;
-        }
-        $allMessageText = MessageText::findUseSlaves()->select('ID')->where('CREATED_AT>=:LAST_PULL_TIME AND IS_DEL=0', [':LAST_PULL_TIME'=>$userInfo['PULLED_AT']])->asArray()->all();
-
-        $db = Yii::$app->db;
-        $transaction = $db->beginTransaction();
-        try {
-            $insertData = [];
-            foreach($allMessageText as $messageText){
-                $insertData[] = [
-                    'USER_ID' => $userId,
-                    'TEXT_ID' => $messageText['ID'],
-                    'CREATED_AT' => Date::nowTime(),
-                ];
-            }
-            Message::batchInsert($insertData);
-            // 更新最后抓取时间
-            $oneUserAr = UserInfo::findOne(['USER_ID'=>$userId]);
-            $oneUserAr->PULLED_AT = Date::nowTime();
-            if(!$oneUserAr->save()){
-                throw new Exception('更新抓取消息时间失败');
-            }
-            $transaction->commit();
-        } catch (Exception $e) {
-            $transaction->rollBack();
-            return false;
-        }
-
-        return true;
-    }
-}

+ 0 - 60
common/models/MessageText.php

@@ -1,60 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%MESSAGE_TEXT}}".
- *
- * @property string $ID
- * @property string $TITLE 标题
- * @property string $CONTENT 内容
- * @property string $TO_UID 发给某个会员
- * @property int $IS_DEL 是否删除
- * @property string $ADMIN_ID 管理员ID
- * @property int $CREATED_AT 创建时间
- * @property int $DELETED_AT 删除时间
- */
-class MessageText extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%MESSAGE_TEXT}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['TITLE', 'CONTENT', 'CREATED_AT'], 'required'],
-            [['IS_DEL', 'CREATED_AT', 'DELETED_AT'], 'integer'],
-            [['ID', 'TO_UID', 'ADMIN_ID'], 'string', 'max' => 32],
-            [['TITLE'], 'string', 'max' => 20],
-            [['CONTENT'], 'string', 'max' => 4000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'TITLE' => '标题',
-            'CONTENT' => '内容',
-            'TO_UID' => '发给某个会员',
-            'IS_DEL' => '是否删除',
-            'ADMIN_ID' => '管理员ID',
-            'CREATED_AT' => '创建时间',
-            'DELETED_AT' => '删除时间',
-        ];
-    }
-}

+ 0 - 138
common/models/OcrApi.php

@@ -1,138 +0,0 @@
-<?php
-
-namespace common\models;
-
-use common\helpers\Cache;
-use Yii;
-use yii\helpers\Json;
-
-/**
- * This is the model class for table "{{%OCR_API}}".
- *
- * @property string $ID
- * @property string $API_NAME 文件名称
- * @property string $DESCRIPTION 分类
- * @property string $CONFIG 备注
- * @property int $STATUS 文件路径
- * @property string $CREATE_ADMIN 创建管理员
- * @property string $UPDATE_ADMIN 更新管理员
- * @property int $CREATED_AT 创建时间
- * @property int $UPDATED_AT 更新时间
- */
-class OcrApi extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%OCR_API}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['API_NAME', 'DESCRIPTION', 'CREATE_ADMIN', 'CREATED_AT'], 'required'],
-            [['STATUS', 'CREATED_AT', 'UPDATED_AT'], 'integer'],
-            [['ID', 'CREATE_ADMIN', 'UPDATE_ADMIN'], 'string', 'max' => 32],
-            [['API_NAME'], 'string', 'max' => 48],
-            [['DESCRIPTION'], 'string', 'max' => 255],
-            [['CONFIG'], 'string', 'max' => 4000],
-            [['API_NAME'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'API_NAME' => '文件名称',
-            'DESCRIPTION' => '分类',
-            'CONFIG' => '备注',
-            'STATUS' => '文件路径',
-            'CREATE_ADMIN' => '创建管理员',
-            'UPDATE_ADMIN' => '更新管理员',
-            'CREATED_AT' => '创建时间',
-            'UPDATED_AT' => '更新时间',
-        ];
-    }
-
-    /**
-     * 获取全部数据
-     * @return array|\yii\db\ActiveRecord[]
-     */
-    public static function getAllData(){
-        $allData = static::find()->where('1=1')->orderBy('CREATED_AT ASC')->indexBy('API_NAME')->asArray()->all();
-        foreach($allData as $key=>$data){
-            if($data['CONFIG']){
-                $allData[$key]['CONFIG'] = Json::decode($data['CONFIG']);
-            } else{
-                $allData[$key]['CONFIG'] = [];
-            }
-        }
-        return $allData;
-    }
-
-    /**
-     * 获取当前正在启用的接口
-     * @return array
-     */
-    public static function getActiveData(){
-        $data = static::find()->where('STATUS=:STATUS', [':STATUS' => 1])->orderBy('CREATED_AT ASC')->asArray()->one();
-        if($data['CONFIG']){
-            $data['CONFIG'] = Json::decode($data['CONFIG']);
-        } else {
-            $data['CONFIG'] = null;
-        }
-        return $data;
-    }
-
-    /**
-     * 从缓存获取信息
-     * @return array|mixed|\yii\db\ActiveRecord[]
-     */
-    public static function getFromCache(){
-        $data = Yii::$app->cache->get(Cache::OCR_API_CONFIG_KEY);
-        if(!$data){
-            // 获取信息
-            $data = self::getActiveData();
-            Yii::$app->cache->set(Cache::OCR_API_CONFIG_KEY, $data);
-        }
-        return $data;
-    }
-
-    /**
-     *  更新缓存
-     * @return array|\yii\db\ActiveRecord[]
-     */
-    public static function updateToCache(){
-        // 获取配置
-        $data = self::getActiveData();
-        Yii::$app->cache->set(Cache::OCR_API_CONFIG_KEY, $data);
-        return $data;
-    }
-
-    /**
-     * 按id获取配置
-     * @param $id
-     * @return array
-     */
-    public static function getConfigById($id) {
-        $smsApi = self::findOneAsArray('ID=:ID',[':ID'=>$id],'CONFIG');
-        $config = json_decode($smsApi['CONFIG'],true);
-        $data = [];
-        foreach ($config as $key=>$value){
-            $data[$key]['label'] = $key;
-            $data[$key]['value'] = $value;
-        }
-        return $data;
-    }
-
-}

+ 0 - 83
common/models/OpenBank.php

@@ -1,83 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%OPEN_BANK}}".
- *
- * @property string $ID
- * @property string $BANK_NAME 银行名称
- * @property string $BANK_CODE 银行代码
- * @property int $LIST_ORDER 排序
- * @property int $CREATED_AT 创建时间
- * @property int $UPDATED_AT 更新时间
- * @property string $ADM_NAME 操作人
- * @property string $MIN_CHARGE 最低手续费
- * @property string $MAX_CHARGE 最高手续费
- * @property string $CHARGE_PROP 手续费比例
- * @property string $UPDATER 更新人
- * @property int $STATUS 状态
- */
-class OpenBank extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%OPEN_BANK}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['BANK_NAME', 'BANK_CODE', 'ADM_NAME'], 'required'],
-            [['LIST_ORDER', 'CREATED_AT', 'UPDATED_AT', 'STATUS'], 'integer'],
-            [['MIN_CHARGE', 'MAX_CHARGE', 'CHARGE_PROP'], 'number'],
-            [['ID', 'BANK_CODE'], 'string', 'max' => 32],
-            [['BANK_NAME'], 'string', 'max' => 64],
-            [['ADM_NAME', 'UPDATER'], 'string', 'max' => 16],
-            [['BANK_CODE'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'BANK_NAME' => '银行名称',
-            'BANK_CODE' => '银行代码',
-            'LIST_ORDER' => '排序',
-            'CREATED_AT' => '创建时间',
-            'UPDATED_AT' => '更新时间',
-            'ADM_NAME' => '操作人',
-            'MIN_CHARGE' => '最低手续费',
-            'MAX_CHARGE' => '最高手续费',
-            'CHARGE_PROP' => '手续费比例',
-            'UPDATER' => '更新人',
-            'STATUS' => '状态',
-        ];
-    }
-
-    public static function getCnName($code){
-        $data = static::findOneAsArray('BANK_CODE=:BANK_CODE', [':BANK_CODE' => $code], 'BANK_NAME');
-        return $data ? $data['BANK_NAME'] : '';
-    }
-
-    /**
-     * 获取全部银行
-     * @return array|\yii\db\ActiveRecord[]
-     */
-    public static function getAllOpenBank(){
-        return self::find()->where('1=1')->indexBy('BANK_CODE')->orderBy('CREATED_AT ASC')->asArray()->all();
-    }
-}

+ 0 - 151
common/models/Order.php

@@ -1,151 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER}}".
- *
- * @property string $ID
- * @property string $SN 订单号
- * @property string $DEC_SN 报单编号
- * @property string $USER_ID 用户ID
- * @property string $USER_NAME 会员编号
- * @property string $ORDER_TYPE 订货类型
- * @property string $ORDER_AMOUNT 订单总价格(n)
- * @property string $ORDER_AMOUNT_STANDARD 订单总价格($)
- * @property string $PV 订货PV
- * @property string $PAY_AMOUNT 支付价格
- * @property string $PAY_AMOUNT_STANDARD 支付价格
- * @property string $EXCHANGE_RATE 汇率
- * @property string $PAY_PV 实付PV
- * @property int $PAY_AT 支付时间
- * @property string $PAY_TYPE 支付方式
- * @property string $FREIGHT 运费
- * @property string $PAY_FREIGHT 实付运费金额
- * @property int $DELIVERY_STATUS 发货状态
- * @property int $DELIVERY_PERIOD 发货期数
- * @property int $DELIVERY_AT 发货时间
- * @property string $EXPRESS_COMPANY 快递公司
- * @property string $ORDER_TRACK_NO 快递单号
- * @property int $EXPRESS_TYPE 发货方式
- * @property string $FRONT_REMARK 前台备注
- * @property string $REMARK 后台备注
- * @property int $PERIOD_NUM 期数
- * @property int $STATUS 订单状态
- * @property string $CONSIGNEE 收货人
- * @property string $MOBILE 收货人手机
- * @property string $TEL 固定电话
- * @property int $PROVINCE 省份名称
- * @property int $CITY 城市名称
- * @property int $COUNTY 县区
- * @property string $LGA_NAME
- * @property string $CITY_NAME
- * @property string $ADDRESS 详细地址
- * @property string $P_CALC_MONTH 分区日期
- * @property int $CREATED_AT 订单创建时间
- * @property string $CREATE_USER 订单创建人
- * @property int $UPDATED_AT 修改时间
- * @property string $UPDATER 修改人
- * @property int $IS_DELETE 是否删除
- * @property int $DELETED_AT 删除时间
- * @property int $WAREHOUSE 发货仓
- * @property string $EMAIL 邮箱
- * @property string $NOTE 备注说明
- */
-class Order extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%ORDER}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'USER_NAME', 'ORDER_TYPE', 'CREATE_USER'/*, 'EMAIL'*/], 'required'],
-            [['ORDER_AMOUNT', 'PV', 'PAY_AMOUNT', 'PAY_PV', 'FREIGHT', 'PAY_FREIGHT', 'ORDER_AMOUNT_STANDARD', 'PAY_AMOUNT_STANDARD', 'EXCHANGE_RATE'], 'number'],
-            [['PAY_AT', 'DELIVERY_STATUS', 'DELIVERY_PERIOD', 'DELIVERY_AT', 'EXPRESS_TYPE', 'PERIOD_NUM', 'STATUS', 'PROVINCE', /*'CITY', 'COUNTY', */'CREATED_AT', 'UPDATED_AT', 'IS_DELETE', 'DELETED_AT'], 'integer'],
-            [['ID','SN', 'DEC_SN', 'USER_ID', 'ORDER_TRACK_NO','PAY_TYPE'], 'string', 'max' => 32],
-            [['USER_NAME', 'TEL', 'CREATE_USER', 'UPDATER', 'WAREHOUSE'], 'string', 'max' => 16],
-            [['ORDER_TYPE'], 'string', 'max' => 12],
-            [['EXPRESS_COMPANY'], 'string', 'max' => 128],
-            [['FRONT_REMARK'], 'string', 'max' => 1000],
-            [['REMARK', 'NOTE'], 'string', 'max' => 4000],
-            [['CONSIGNEE'], 'string', 'max' => 120],
-            [['MOBILE'], 'string', 'max' => 11],
-            [['ADDRESS'], 'string', 'max' => 255],
-            [['SN'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'SN' => '订单号',
-            'DEC_SN' => '报单编号',
-            'USER_ID' => '用户ID',
-            'USER_NAME' => '会员编号',
-            'ORDER_TYPE' => '订货类型',
-            'ORDER_AMOUNT' => '订单总价格',
-            'PV' => '订货BV',
-            'PAY_AMOUNT' => '支付价格',
-            'PAY_PV' => '实付BV',
-            'PAY_AT' => '支付时间',
-            'PAY_TYPE' => '支付方式',
-            'FREIGHT' => '运费',
-            'PAY_FREIGHT' => '实付运费金额',
-            'DELIVERY_STATUS' => '发货状态',
-            'DELIVERY_PERIOD' => '发货期数',
-            'DELIVERY_AT' => '发货时间',
-            'EXPRESS_COMPANY' => '快递公司',
-            'ORDER_TRACK_NO' => '快递单号',
-            'EXPRESS_TYPE' => '发货方式',
-            'FRONT_REMARK' => '前台备注',
-            'REMARK' => '后台备注',
-            'PERIOD_NUM' => '期数',
-            'STATUS' => '订单状态',
-            'CONSIGNEE' => '收货人',
-            'MOBILE' => '收货人手机',
-            'TEL' => '固定电话',
-            'PROVINCE' => '省份名称',
-//            'CITY' => '城市名称',
-//            'COUNTY' => '县区',
-            'ADDRESS' => '详细地址',
-            'P_CALC_MONTH' => '分区日期',
-            'CREATED_AT' => '订单创建时间',
-            'CREATE_USER' => '订单创建人',
-            'UPDATED_AT' => '修改时间',
-            'UPDATER' => '修改人',
-            'IS_DELETE' => '是否删除',
-            'DELETED_AT' => '删除时间',
-            'WAREHOUSE' => '发货仓',
-            'EMAIL' => 'Email'
-        ];
-    }
-    /*
-     * 通过 期数和用户ID
-     * 查询当月订单
-     */
-    public static function fetchOrderCurrentMonth($periodNum, $userId){
-        if($periodNum % 2 == 0){
-            $periods = [$periodNum-1, $periodNum];
-        }else{
-            $periods = [$periodNum];
-        }
-        $periodsStr = implode(",", $periods);
-        $orders = Order::find()->where("USER_ID = '$userId' AND PERIOD_NUM IN (' . $periodsStr . ')");
-        return $orders;
-    }
-}

+ 0 - 131
common/models/OrderDec.php

@@ -1,131 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER_DEC}}".
- *
- * @property string $ID
- * @property string $SN 订单号
- * @property string $DEC_SN 报单编号
- * @property string $USER_ID 用户ID
- * @property string $USER_NAME 会员编号
- * @property string $ORDER_TYPE 订货类型
- * @property string $ORDER_AMOUNT 订单总价格
- * @property string $PV 订货PV
- * @property string $PAY_AMOUNT 支付价格
- * @property string $PAY_PV 实付PV
- * @property int $PAY_AT 支付时间
- * @property string $PAY_TYPE 支付方式
- * @property string $FREIGHT 运费
- * @property string $PAY_FREIGHT 实付运费金额
- * @property int $DELIVERY_STATUS 发货状态
- * @property int $DELIVERY_PERIOD 发货期数
- * @property int $DELIVERY_AT 发货时间
- * @property string $EXPRESS_COMPANY 快递公司
- * @property string $ORDER_TRACK_NO 快递单号
- * @property int $EXPRESS_TYPE 发货方式
- * @property string $FRONT_REMARK 前台备注
- * @property string $REMARK 后台备注
- * @property int $PERIOD_NUM 期数
- * @property int $ORDER_DAY 日期
- * @property int $STATUS 订单状态
- * @property string $CONSIGNEE 收货人
- * @property string $MOBILE 收货人手机
- * @property string $TEL 固定电话
- * @property string $PROVINCE 省份名称
- * @property string $CITY 城市名称
- * @property string $COUNTY 县区
- * @property string $ADDRESS 详细地址
- * @property string $P_CALC_MONTH 分区日期
- * @property int $CREATED_AT 订单创建时间
- * @property string $CREATE_USER 订单创建人
- * @property int $UPDATED_AT 修改时间
- * @property string $UPDATER 修改人
- * @property int $IS_DELETE 是否删除
- * @property int $DELETED_AT 删除时间
- * @property int $WAREHOUSE 发货仓
- */
-class OrderDec extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%ORDER_DEC}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'USER_NAME', 'ORDER_TYPE', 'CREATE_USER'], 'required'],
-            [['ORDER_AMOUNT', 'PV', 'PAY_AMOUNT', 'PAY_PV', 'FREIGHT', 'PAY_FREIGHT'], 'number'],
-            [['PAY_AT', 'DELIVERY_STATUS', 'DELIVERY_PERIOD', 'DELIVERY_AT', 'EXPRESS_TYPE', 'PERIOD_NUM', 'STATUS', 'CREATED_AT', 'UPDATED_AT', 'IS_DELETE', 'DELETED_AT'], 'integer'],
-            [['ID','SN', 'DEC_SN', 'USER_ID', 'ORDER_TRACK_NO','PAY_TYPE', 'PROVINCE', 'CITY', 'COUNTY'], 'string', 'max' => 32],
-            [['USER_NAME', 'TEL', 'CREATE_USER', 'UPDATER', 'WAREHOUSE', 'ORDER_DAY'], 'string', 'max' => 16],
-            [['ORDER_TYPE'], 'string', 'max' => 12],
-            [['EXPRESS_COMPANY'], 'string', 'max' => 128],
-            [['FRONT_REMARK'], 'string', 'max' => 1000],
-            [['REMARK'], 'string', 'max' => 4000],
-            [['CONSIGNEE'], 'string', 'max' => 120],
-            [['MOBILE'], 'string', 'max' => 11],
-            [['ADDRESS'], 'string', 'max' => 255],
-            [['SN'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'SN' => '订单号',
-            'DEC_SN' => '报单编号',
-            'USER_ID' => '用户ID',
-            'USER_NAME' => '会员编号',
-            'ORDER_TYPE' => '订货类型',
-            'ORDER_AMOUNT' => '订单总价格',
-            'PV' => '订货BV',
-            'PAY_AMOUNT' => '支付价格',
-            'PAY_PV' => '实付BV',
-            'PAY_AT' => '支付时间',
-            'PAY_TYPE' => '支付方式',
-            'FREIGHT' => '运费',
-            'PAY_FREIGHT' => '实付运费金额',
-            'DELIVERY_STATUS' => '发货状态',
-            'DELIVERY_PERIOD' => '发货期数',
-            'DELIVERY_AT' => '发货时间',
-            'EXPRESS_COMPANY' => '快递公司',
-            'ORDER_TRACK_NO' => '快递单号',
-            'EXPRESS_TYPE' => '发货方式',
-            'FRONT_REMARK' => '前台备注',
-            'REMARK' => '后台备注',
-            'PERIOD_NUM' => '期数',
-            'ORDER_DAY' => '日期',
-            'STATUS' => '订单状态',
-            'CONSIGNEE' => '收货人',
-            'MOBILE' => '收货人手机',
-            'TEL' => '固定电话',
-            'PROVINCE' => '省份名称',
-            'CITY' => '城市名称',
-            'COUNTY' => '县区',
-            'ADDRESS' => '详细地址',
-            'P_CALC_MONTH' => '分区日期',
-            'CREATED_AT' => '订单创建时间',
-            'CREATE_USER' => '订单创建人',
-            'UPDATED_AT' => '修改时间',
-            'UPDATER' => '修改人',
-            'IS_DELETE' => '是否删除',
-            'DELETED_AT' => '删除时间',
-            'WAREHOUSE' => '发货仓',
-        ];
-    }
-}

+ 0 - 77
common/models/OrderGoods.php

@@ -1,77 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER_GOODS}}".
- *
- * @property string $ID
- * @property string $ORDER_SN 订单ID
- * @property string $GOODS_ID 商品ID
- * @property string $GOODS_TITLE 商品名称
- * @property string $PRICE 价格
- * @property string $REAL_PRICE 实际价格
- * @property string $PV 订货PV
- * @property string $REAL_PV 实际PV
- * @property string $TAX_RATE 税率
- * @property string $POINT 兑换积分
- * @property string $SKU_CODE 商品编码
- * @property int $BUY_NUMS 购买数量
- * @property string $P_CALC_MONTH 分区日期
- * @property int CATEGORY_TYPE 商品分类
- * @property int PAY_TYPE 支付方式
- * @property string $EMAIL Email
- */
-class OrderGoods extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%ORDER_GOODS}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ORDER_SN', 'GOODS_ID', 'GOODS_TITLE', 'SKU_CODE', 'CATEGORY_TYPE', 'PAY_TYPE', 'EMAIL'], 'required'],
-            [['PRICE', 'REAL_PRICE', 'PV', 'REAL_PV', 'POINT', 'CATEGORY_TYPE', 'PAY_TYPE', 'TAX_RATE'], 'number'],
-            [['BUY_NUMS'], 'integer'],
-            [['ID', 'ORDER_SN', 'GOODS_ID'], 'string', 'max' => 32],
-            [['GOODS_TITLE'], 'string', 'max' => 255],
-            [['SKU_CODE'], 'string', 'max' => 16],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'ORDER_SN' => '订单ID',
-            'GOODS_ID' => '商品ID',
-            'GOODS_TITLE' => '商品名称',
-            'PRICE' => '价格',
-            'REAL_PRICE' => '实际价格',
-            'PV' => '订货BV',
-            'REAL_PV' => '实际BV',
-            'TAX_RATE' => 'TAX_RATE',
-            'POINT' => '兑换积分',
-            'SKU_CODE' => '商品编码',
-            'BUY_NUMS' => '购买数量',
-            'P_CALC_MONTH' => '分区日期',
-            'CATEGORY_TYPE' => '商品分类',
-            'PAY_TYPE' => '支付方式',
-            'EMAIL' => 'Email'
-        ];
-    }
-}

+ 0 - 71
common/models/OrderGoodsDec.php

@@ -1,71 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER_GOODS_DEC}}".
- *
- * @property string $ID
- * @property string $ORDER_SN 订单ID
- * @property string $GOODS_TITLE 商品名称
- * @property string $PRICE 价格
- * @property string $REAL_PRICE 实际价格
- * @property string $PV 订货PV
- * @property string $REAL_PV 实际PV
- * @property string $POINT 兑换积分
- * @property int $PERIOD_NUM 期数
- * @property int $ORDER_DAY 日期
- * @property string $SKU_CODE 商品编码
- * @property int $BUY_NUMS 购买数量
- * @property string $P_CALC_MONTH 分区日期
- */
-class OrderGoodsDec extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%ORDER_GOODS_DEC}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ORDER_SN', 'GOODS_TITLE', 'SKU_CODE'], 'required'],
-            [['PRICE', 'REAL_PRICE', 'PV', 'REAL_PV', 'POINT'], 'number'],
-            [['BUY_NUMS', 'PERIOD_NUM'], 'integer'],
-            [['ID', 'ORDER_SN'], 'string', 'max' => 32],
-            [['GOODS_TITLE'], 'string', 'max' => 255],
-            [['SKU_CODE','ORDER_DAY'], 'string', 'max' => 16],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'ORDER_SN' => '订单ID',
-            'GOODS_TITLE' => '商品名称',
-            'PRICE' => '价格',
-            'REAL_PRICE' => '实际价格',
-            'PV' => '订货BV',
-            'REAL_PV' => '实际BV',
-            'POINT' => '兑换积分',
-            'PERIOD_NUM' => '期数',
-            'ORDER_DAY' => '日期',
-            'SKU_CODE' => '商品编码',
-            'BUY_NUMS' => '购买数量',
-            'P_CALC_MONTH' => '分区日期',
-        ];
-    }
-}

+ 0 - 69
common/models/OrderGoodsShop.php

@@ -1,69 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER_GOODS}}".
- *
- * @property string $ID
- * @property string $ORDER_SN 订单ID
- * @property string $GOODS_TITLE 商品名称
- * @property string $PRICE 价格
- * @property string $REAL_PRICE 实际价格
- * @property string $PV 订货PV
- * @property string $REAL_PV 实际PV
- * @property string $POINT 兑换积分
- * @property int $PERIOD_NUM 期数
- * @property string $SKU_CODE 商品编码
- * @property int $BUY_NUMS 购买数量
- * @property string $P_CALC_MONTH 分区日期
- */
-class OrderGoodsShop extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%ORDER_GOODS_SHOP}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ORDER_SN', 'GOODS_TITLE', 'SKU_CODE'], 'required'],
-            [['PRICE', 'REAL_PRICE', 'PV', 'REAL_PV', 'POINT'], 'number'],
-            [['BUY_NUMS', 'PERIOD_NUM'], 'integer'],
-            [['ID', 'ORDER_SN'], 'string', 'max' => 32],
-            [['GOODS_TITLE'], 'string', 'max' => 255],
-            [['SKU_CODE'], 'string', 'max' => 16],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'ORDER_SN' => '订单ID',
-            'GOODS_TITLE' => '商品名称',
-            'PRICE' => '价格',
-            'REAL_PRICE' => '实际价格',
-            'PV' => '订货BV',
-            'REAL_PV' => '实际BV',
-            'POINT' => '兑换积分',
-            'PERIOD_NUM' => '期数',
-            'SKU_CODE' => '商品编码',
-            'BUY_NUMS' => '购买数量',
-            'P_CALC_MONTH' => '分区日期',
-        ];
-    }
-}

+ 0 - 131
common/models/OrderShop.php

@@ -1,131 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER}}".
- *
- * @property string $ID
- * @property string $SN 订单号
- * @property string $DEC_SN 报单编号
- * @property string $USER_ID 用户ID
- * @property string $USER_NAME 会员编号
- * @property string $ORDER_TYPE 订货类型
- * @property string $ORDER_AMOUNT 订单总价格
- * @property string $PV 订货PV
- * @property string $PAY_AMOUNT 支付价格
- * @property string $PAY_PV 实付PV
- * @property int $PAY_AT 支付时间
- * @property string $PAY_TYPE 支付方式
- * @property string $FREIGHT 运费
- * @property string $PAY_FREIGHT 实付运费金额
- * @property int $DELIVERY_STATUS 发货状态
- * @property int $DELIVERY_PERIOD 发货期数
- * @property int $DELIVERY_AT 发货时间
- * @property string $EXPRESS_COMPANY 快递公司
- * @property string $ORDER_TRACK_NO 快递单号
- * @property int $EXPRESS_TYPE 发货方式
- * @property string $FRONT_REMARK 前台备注
- * @property string $REMARK 后台备注
- * @property int $PERIOD_NUM 期数
- * @property int $ORDER_DAY 日期
- * @property int $STATUS 订单状态
- * @property string $CONSIGNEE 收货人
- * @property string $MOBILE 收货人手机
- * @property string $TEL 固定电话
- * @property string $PROVINCE 省份名称
- * @property string $CITY 城市名称
- * @property string $COUNTY 县区
- * @property string $ADDRESS 详细地址
- * @property string $P_CALC_MONTH 分区日期
- * @property int $CREATED_AT 订单创建时间
- * @property string $CREATE_USER 订单创建人
- * @property int $UPDATED_AT 修改时间
- * @property string $UPDATER 修改人
- * @property int $IS_DELETE 是否删除
- * @property int $DELETED_AT 删除时间
- * @property int $WAREHOUSE 发货仓
- */
-class OrderShop extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%ORDER_SHOP}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'USER_NAME', 'ORDER_TYPE', 'CREATE_USER'], 'required'],
-            [['ORDER_AMOUNT', 'PV', 'PAY_AMOUNT', 'PAY_PV', 'FREIGHT', 'PAY_FREIGHT'], 'number'],
-            [['PAY_AT', 'DELIVERY_STATUS', 'DELIVERY_PERIOD', 'DELIVERY_AT', 'EXPRESS_TYPE', 'PERIOD_NUM', 'STATUS', 'CREATED_AT', 'UPDATED_AT', 'IS_DELETE', 'DELETED_AT'], 'integer'],
-            [['ID','SN', 'DEC_SN', 'USER_ID', 'ORDER_TRACK_NO','PAY_TYPE', 'PROVINCE', 'CITY', 'COUNTY'], 'string', 'max' => 32],
-            [['USER_NAME', 'TEL', 'CREATE_USER', 'UPDATER', 'WAREHOUSE', 'ORDER_DAY'], 'string', 'max' => 16],
-            [['ORDER_TYPE'], 'string', 'max' => 12],
-            [['EXPRESS_COMPANY'], 'string', 'max' => 128],
-            [['FRONT_REMARK'], 'string', 'max' => 1000],
-            [['REMARK'], 'string', 'max' => 4000],
-            [['CONSIGNEE'], 'string', 'max' => 120],
-            [['MOBILE'], 'string', 'max' => 11],
-            [['ADDRESS'], 'string', 'max' => 255],
-            [['SN'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'SN' => '订单号',
-            'DEC_SN' => '报单编号',
-            'USER_ID' => '用户ID',
-            'USER_NAME' => '会员编号',
-            'ORDER_TYPE' => '订货类型',
-            'ORDER_AMOUNT' => '订单总价格',
-            'PV' => '订货PV',
-            'PAY_AMOUNT' => '支付价格',
-            'PAY_PV' => '实付PV',
-            'PAY_AT' => '支付时间',
-            'PAY_TYPE' => '支付方式',
-            'FREIGHT' => '运费',
-            'PAY_FREIGHT' => '实付运费金额',
-            'DELIVERY_STATUS' => '发货状态',
-            'DELIVERY_PERIOD' => '发货期数',
-            'DELIVERY_AT' => '发货时间',
-            'EXPRESS_COMPANY' => '快递公司',
-            'ORDER_TRACK_NO' => '快递单号',
-            'EXPRESS_TYPE' => '发货方式',
-            'FRONT_REMARK' => '前台备注',
-            'REMARK' => '后台备注',
-            'PERIOD_NUM' => '期数',
-            'ORDER_DAY' => '日期',
-            'STATUS' => '订单状态',
-            'CONSIGNEE' => '收货人',
-            'MOBILE' => '收货人手机',
-            'TEL' => '固定电话',
-            'PROVINCE' => '省份名称',
-            'CITY' => '城市名称',
-            'COUNTY' => '县区',
-            'ADDRESS' => '详细地址',
-            'P_CALC_MONTH' => '分区日期',
-            'CREATED_AT' => '订单创建时间',
-            'CREATE_USER' => '订单创建人',
-            'UPDATED_AT' => '修改时间',
-            'UPDATER' => '修改人',
-            'IS_DELETE' => '是否删除',
-            'DELETED_AT' => '删除时间',
-            'WAREHOUSE' => '发货仓',
-        ];
-    }
-}

+ 0 - 129
common/models/OrderStandard.php

@@ -1,129 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER_STANDARD}}".
- *
- * @property string $ID
- * @property string $SN
- * @property string $DEC_SN
- * @property string $USER_ID
- * @property string $USER_NAME
- * @property string $ORDER_TYPE
- * @property string $ORDER_AMOUNT
- * @property string $PV
- * @property string $PAY_AMOUNT
- * @property string $PAY_PV
- * @property int $PAY_AT
- * @property double $FREIGHT
- * @property double $PAY_FREIGHT
- * @property int $DELIVERY_STATUS
- * @property int $DELIVERY_PERIOD
- * @property int $DELIVERY_AT
- * @property string $EXPRESS_COMPANY
- * @property string $ORDER_TRACK_NO
- * @property int $EXPRESS_TYPE
- * @property string $FRONT_REMARK
- * @property string $REMARK
- * @property int $PERIOD_NUM
- * @property int $CALC_MONTH 结算月
- * @property int $STATUS
- * @property string $CONSIGNEE
- * @property string $MOBILE
- * @property string $TEL
- * @property string $PROVINCE
- * @property string $CITY
- * @property string $COUNTY
- * @property string $ADDRESS
- * @property int $CREATED_AT
- * @property string $CREATE_USER
- * @property int $UPDATED_AT
- * @property string $UPDATER
- * @property int $IS_DELETE
- * @property int $DELETED_AT
- * @property string $PAY_TYPE
- * @property string $WAREHOUSE
- */
-class OrderStandard extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%ORDER_STANDARD}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ID', 'USER_ID', 'USER_NAME', 'ORDER_TYPE', 'CALC_MONTH', 'CREATE_USER'], 'required'],
-            [['ORDER_AMOUNT', 'PV', 'PAY_AMOUNT', 'PAY_PV', 'FREIGHT', 'PAY_FREIGHT'], 'number'],
-            [['PAY_AT', 'DELIVERY_STATUS', 'DELIVERY_PERIOD', 'DELIVERY_AT', 'EXPRESS_TYPE', 'PERIOD_NUM', 'CALC_MONTH', 'STATUS', 'CREATED_AT', 'UPDATED_AT', 'IS_DELETE', 'DELETED_AT'], 'integer'],
-            [['REMARK'], 'string'],
-            [['ID', 'SN', 'DEC_SN', 'USER_ID', 'ORDER_TRACK_NO', 'PROVINCE', 'CITY', 'COUNTY', 'PAY_TYPE'], 'string', 'max' => 32],
-            [['USER_NAME', 'TEL', 'CREATE_USER', 'UPDATER', 'WAREHOUSE'], 'string', 'max' => 16],
-            [['ORDER_TYPE'], 'string', 'max' => 12],
-            [['EXPRESS_COMPANY'], 'string', 'max' => 128],
-            [['FRONT_REMARK'], 'string', 'max' => 1000],
-            [['CONSIGNEE'], 'string', 'max' => 120],
-            [['MOBILE'], 'string', 'max' => 11],
-            [['ADDRESS'], 'string', 'max' => 255],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'SN' => 'Sn',
-            'DEC_SN' => 'Dec  Sn',
-            'USER_ID' => 'User  ID',
-            'USER_NAME' => 'User  Name',
-            'ORDER_TYPE' => 'Order  Type',
-            'ORDER_AMOUNT' => 'Order  Amount',
-            'PV' => 'Pv',
-            'PAY_AMOUNT' => 'Pay  Amount',
-            'PAY_PV' => 'Pay  Bv',
-            'PAY_AT' => 'Pay  At',
-            'FREIGHT' => 'Freight',
-            'PAY_FREIGHT' => 'Pay  Freight',
-            'DELIVERY_STATUS' => 'Delivery  Status',
-            'DELIVERY_PERIOD' => 'Delivery  Period',
-            'DELIVERY_AT' => 'Delivery  At',
-            'EXPRESS_COMPANY' => 'Express  Company',
-            'ORDER_TRACK_NO' => 'Order  Track  No',
-            'EXPRESS_TYPE' => 'Express  Type',
-            'FRONT_REMARK' => 'Front  Remark',
-            'REMARK' => 'Remark',
-            'PERIOD_NUM' => 'Period  Num',
-            'CALC_MONTH' => '结算月',
-            'STATUS' => 'Status',
-            'CONSIGNEE' => 'Consignee',
-            'MOBILE' => 'Mobile',
-            'TEL' => 'Tel',
-            'PROVINCE' => 'Province',
-            'CITY' => 'City',
-            'COUNTY' => 'County',
-            'ADDRESS' => 'Address',
-            'CREATED_AT' => 'Created  At',
-            'CREATE_USER' => 'Create  User',
-            'UPDATED_AT' => 'Updated  At',
-            'UPDATER' => 'Updater',
-            'IS_DELETE' => 'Is  Delete',
-            'DELETED_AT' => 'Deleted  At',
-            'PAY_TYPE' => 'Pay  Type',
-            'WAREHOUSE' => 'Warehouse',
-        ];
-    }
-}

+ 0 - 71
common/models/OrderStandardGoods.php

@@ -1,71 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORDER_STANDARD_GOODS}}".
- *
- * @property string $ID
- * @property string $ORDER_SN
- * @property string $GOODS_TITLE
- * @property string $PRICE
- * @property string $REAL_PRICE
- * @property string $PV
- * @property string $REAL_PV
- * @property string $SKU_CODE
- * @property int $BUY_NUMS
- * @property int $POINT
- * @property int $PERIOD_NUM
- * @property int $CALC_MONTH 结算月
- * @property string $PAY_TYPE
- */
-class OrderStandardGoods extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%ORDER_STANDARD_GOODS}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ID', 'ORDER_SN', 'GOODS_TITLE', 'SKU_CODE', 'CALC_MONTH'], 'required'],
-            [['PRICE', 'REAL_PRICE', 'PV', 'REAL_PV'], 'number'],
-            [['BUY_NUMS', 'POINT', 'PERIOD_NUM', 'CALC_MONTH'], 'integer'],
-            [['ID', 'ORDER_SN', 'PAY_TYPE'], 'string', 'max' => 32],
-            [['GOODS_TITLE'], 'string', 'max' => 255],
-            [['SKU_CODE'], 'string', 'max' => 16],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'ORDER_SN' => 'Order  Sn',
-            'GOODS_TITLE' => 'Goods  Title',
-            'PRICE' => 'Price',
-            'REAL_PRICE' => 'Real  Price',
-            'PV' => 'Bv',
-            'REAL_PV' => 'Real  Bv',
-            'SKU_CODE' => 'Sku  Code',
-            'BUY_NUMS' => 'Buy  Nums',
-            'POINT' => 'Point',
-            'PERIOD_NUM' => 'Period  Num',
-            'CALC_MONTH' => '结算月',
-            'PAY_TYPE' => 'Pay  Type',
-        ];
-    }
-}

+ 0 - 52
common/models/OriginDecPv.php

@@ -1,52 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%ORIGIN_DEC_PV}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property int $TYPE 报单类型
- * @property string $INSERT_USER_ID 首购会员ID
- * @property string $DEC_AMOUNT 报单金额
- * @property string $DEC_PV 报单PV
- * @property int $PERIOD_NUM 报单期数
- * @property int $STATUS 状态
- * @property int $CREATED_AT 创建时间
- */
-class OriginDecPv extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%ORIGIN_DEC_PV}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'DEC_PV', 'ACTION_TYPE'], 'required'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'DEC_PV' => '报单PV值',
-            'ACTION_TYPE' => '操作类型默认0无操作  1为增加  2为减少',
-        ];
-    }
-}

+ 0 - 64
common/models/PerfStandard.php

@@ -1,64 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%PERF_STANDARD}}".
- *
- * @property string $ID ID
- * @property string $USER_ID 会员ID
- * @property string $LAST_DEC_LV 结算时会员级别
- * @property string $LAST_EMP_LV 结算时会员聘级
- * @property int $LAST_STATUS 结算时的状态
- * @property string $AMOUNT_PCS 个人销售额
- * @property string $AMOUNT_PSS 团队销售额
- * @property int $CALC_MONTH 结算月
- * @property string $P_CALC_MONTH 表分区日期索引
- * @property int $CREATED_AT 创建时间
- */
-class PerfStandard extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%PERF_STANDARD}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ID', 'USER_ID', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['LAST_STATUS', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['AMOUNT_PCS', 'AMOUNT_PSS'], 'number'],
-            [['P_CALC_MONTH'], 'safe'],
-            [['ID', 'USER_ID', 'LAST_DEC_LV', 'LAST_EMP_LV'], 'string', 'max' => 32],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'LAST_DEC_LV' => '结算时会员级别',
-            'LAST_EMP_LV' => '结算时会员聘级',
-            'LAST_STATUS' => '结算时的状态',
-            'AMOUNT_PCS' => '个人销售额',
-            'AMOUNT_PSS' => '团队销售额',
-            'CALC_MONTH' => '结算月',
-            'P_CALC_MONTH' => '表分区日期索引',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}

+ 0 - 79
common/models/ReceiveAddress.php

@@ -1,79 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%RECEIVE_ADDRESS}}".
- *
- * @property string $ID
- * @property string $USER_ID 用户ID
- * @property string $USER_NAME 用户编号
- * @property string $CONSIGNEE 收货人
- * @property string $MOBILE 收货人手机
- * @property int $PROVINCE 省份名称
- * @property int $CITY 城市名称
- * @property int $COUNTY 县区名称
- * @property string $LGA_NAME Lga
- * @property string $CITY_NAME City
- * @property string $ADDRESS 详细地址
- * @property int $IS_DEFAULT 是否默认
- * @property int $CREATED_AT 创建时间
- * @property string $UPDATER 修改人
- * @property int $UPDATED_AT 修改时间
- */
-class ReceiveAddress extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%RECEIVE_ADDRESS}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'USER_NAME', 'CONSIGNEE', 'MOBILE', 'PROVINCE', /*'LGA_NAME', 'CITY_NAME', */'ADDRESS'], 'required'],
-            [['PROVINCE', 'IS_DEFAULT', 'CREATED_AT', 'UPDATED_AT'], 'integer'],
-            [['ID', 'USER_ID'], 'string', 'max' => 32],
-            [['USER_NAME'], 'string', 'max' => 16],
-            [['CONSIGNEE'], 'string', 'max' => 120],
-            [['MOBILE'], 'string', 'max' => 11],
-            [['ADDRESS'], 'string', 'max' => 255],
-            [['LGA_NAME'], 'string', 'max' => 50],
-            [['CITY_NAME'], 'string', 'max' => 50],
-            [['UPDATER'], 'string', 'max' => 10],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '用户ID',
-            'USER_NAME' => '用户编号',
-            'CONSIGNEE' => '收货人',
-            'MOBILE' => '收货人手机',
-            'PROVINCE' => '省份名称',
-            'CITY' => '城市名称',
-            'COUNTY' => '县区名称',
-            'LGA_NAME' => 'Lga Name',
-            'CITY_NAME' => 'City Name',
-            'ADDRESS' => '详细地址',
-            'IS_DEFAULT' => '是否默认',
-            'CREATED_AT' => '创建时间',
-            'UPDATER' => '修改人',
-            'UPDATED_AT' => '修改时间',
-        ];
-    }
-}

+ 0 - 234
common/models/Recharge.php

@@ -1,234 +0,0 @@
-<?php
-
-namespace common\models;
-
-use common\helpers\user\Info;
-use Yii;
-
-/**
- * This is the model class for table "{{%RECHARGE}}".
- *
- * @property string $ID
- * @property string $SN 单号
- * @property string $USER_ID 会员ID
- * @property string $ID_CARD 身份证号
- * @property int $RECHARGE_PERIOD_NUM 充值期数
- * @property int $RECHARGE_YEAR 充值年份
- * @property int $RECHARGE_MONTH 充值月份
- * @property string $CURRENCY 货币(尼日利亚默认NGN)
- * @property string $AMOUNT 充值金额
- * @property string $RECHARGE_ORDER_ID PS订单号
- * @property int $RECHARGE_STATUS 充值状态
- * @property string $REAL_NAME 会员姓名
- * @property string $OPEN_BANK 开户行
- * @property string $BANK_ADDRESS 开户支行
- * @property string $BANK_NO 银行账号
- * @property int $BANK_PROVINCE 银行省份
- * @property int $BANK_CITY 银行城市
- * @property int $BANK_COUNTY 银行地区
- * @property string $BANK_PROVE 打款凭证
- * @property string $P_MONTH 表分区标识
- * @property int $AUDIT_STATUS 审核状态
- * @property string $REMARK 审核备注
- * @property string $AUDIT_ADMIN 审核管理员
- * @property int $CREATED_AT 创建时间
- * @property int $AUDITED_AT 审核时间
- */
-class Recharge extends \common\components\ActiveRecord {
-    const TYPE_MANUAL = 0;      // 手动充值
-    const TYPE_AUTO = 1;        // 自动充值
-    const TYPE_ADMIN = 2;       // 后台管理员
-
-
-    const STATUS_APPLIED = 0;       // 已申请
-    const STATUS_PROVED = 1;       // 已上传凭证
-    const STATUS_AUDITED = 2;       // 已审核
-    const STATUS_REFUSED = 3;       // 已拒绝
-
-    const STATUS_NEW = 0;
-    const STATUS_PROCESSING = 1;
-    const STATUS_SUCCESS = 2;
-    const STATUS_REJECT = 3;
-
-    const STATUS_NAME = [
-        self::STATUS_APPLIED => 'To be reviewed', // 待审核
-        self::STATUS_PROVED => 'Voucher uploaded', // 已上传凭证
-        self::STATUS_AUDITED => 'Approved', // 已审核
-        self::STATUS_REFUSED => 'Rejected', // 已拒绝
-    ];
-
-    const RECHARGE_STATUS_NAME = [
-        self::STATUS_NEW => 'NEW',
-        self::STATUS_PROCESSING => 'PROCESSING',
-        self::STATUS_SUCCESS => 'SUCCESS',
-        self::STATUS_REJECT => 'FAILED',
-    ];
-    /**
-     * @inheritdoc
-     */
-    public static function tableName() {
-        return '{{%RECHARGE}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules() {
-        return [
-            [['USER_ID', 'P_MONTH', 'CREATED_AT'], 'required'],
-            [['RECHARGE_PERIOD_NUM', 'RECHARGE_YEAR', 'RECHARGE_MONTH', 'AUDIT_STATUS', 'CREATED_AT', 'AUDITED_AT', 'BANK_PROVINCE', 'BANK_CITY', 'BANK_COUNTY'], 'integer'],
-            [['AMOUNT'], 'number'],
-            [['ID', 'SN', 'USER_ID', 'OPEN_BANK', 'BANK_NO', 'AUDIT_ADMIN'], 'string', 'max' => 32],
-            [['ID_CARD'], 'string', 'max' => 20],
-            [['REAL_NAME', 'BANK_ADDRESS'], 'string', 'max' => 255],
-            [['REMARK'], 'string', 'max' => 4000],
-            [['ID'], 'unique'],
-            [['SN'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels() {
-        return [
-            'ID' => 'ID',
-            'SN' => '单号',
-            'USER_ID' => '会员ID',
-            'ID_CARD' => '身份证号',
-            'RECHARGE_PERIOD_NUM' => '充值期数',
-            'RECHARGE_YEAR' => '充值年份',
-            'RECHARGE_MONTH' => '充值月份',
-            'CURRENCY' => '货币',
-            'AMOUNT' => '充值金额',
-            'REAL_NAME' => '会员姓名',
-            'OPEN_BANK' => '汇款银行',
-            'BANK_ADDRESS' => '开户支行',
-            'BANK_NO' => '汇款账号',
-            'BANK_PROVINCE' => '银行省份',
-            'BANK_CITY' => '银行城市',
-            'BANK_COUNTY' => '银行地区',
-            'BANK_PROVE' => '打款凭证',
-            'P_MONTH' => '表分区标识',
-            'AUDIT_STATUS' => '审核状态',
-            'REMARK' => '备注',
-            'AUDIT_ADMIN' => '审核管理员',
-            'CREATED_AT' => '创建时间',
-            'AUDITED_AT' => '审核时间',
-        ];
-    }
-
-    /**
-     * 获取充值相关期数,目前按照直接取当月第一期来实现
-     * @param $nowTime
-     * @return array
-     */
-    public static function getPeriod($nowTime) {
-        $period = Period::instance();
-        $year = $period->getNowYear();
-        $month = $period->getNowMonth();
-        $yearMonth = $period->getNowYearMonth();
-        $thisMonth = Period::getPeriodNumRangeFromMonth($year, $month);
-        $period->setPeriodNum($thisMonth['min']);
-        $endTime = $period->getNowPeriodEnd();
-        return ['nowPeriodNum' => $thisMonth['min'], 'nowYear' => $year, 'nowMonth' => $month, 'yearMonth'=>$yearMonth, 'endTime' => $endTime];
-    }
-
-    /**
-     * 会员本月是否充值
-     * @param $uid
-     * @return bool
-     */
-    public static function hasThisMonthRecharge($uid) {
-        $period = Period::instance();
-        $idCard = Info::getIdCardByUserId($uid);
-        if ($idCard) {
-            if (static::find()->where('ID_CARD=:ID_CARD AND RECHARGE_YEAR=:RECHARGE_YEAR AND RECHARGE_MONTH=:RECHARGE_MONTH', [':ID_CARD' => $idCard, ':RECHARGE_YEAR' => $period->getNowYear(), ':RECHARGE_MONTH' => $period->getNowMonth()])->exists()) {
-                return true;
-            }
-        } else {
-            if (static::find()->where('USER_ID=:USER_ID AND RECHARGE_YEAR=:RECHARGE_YEAR AND RECHARGE_MONTH=:RECHARGE_MONTH', [':USER_ID' => $uid, ':RECHARGE_YEAR' => $period->getNowYear(), ':RECHARGE_MONTH' => $period->getNowMonth()])->exists()) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    /**
-     * 判断充值状态
-     * @param $sn
-     * @param $nowStatus
-     * @param $toStatus
-     * @return string
-     */
-    public static function chkAuditStatus($sn, $nowStatus, $toStatus) {
-        $statusName = self::STATUS_NAME;
-        $msg = '充值单' . $sn . '当前状态为【' . $statusName[$nowStatus] . '】,无法设置为【' . $statusName[$toStatus] . '】';
-        switch ($toStatus) {
-            //已审核
-            case Recharge::STATUS_AUDITED:
-                if (($nowStatus == Recharge::STATUS_APPLIED) || ($nowStatus == Recharge::STATUS_PROVED)) {
-                    $msg = '';
-                }
-                break;
-            //审核拒绝
-            case Recharge::STATUS_REFUSED:
-                if (($nowStatus == Recharge::STATUS_APPLIED) || ($nowStatus == Recharge::STATUS_PROVED)) {
-                    $msg = '';
-                }
-                break;
-            default:
-        }
-        return $msg;
-    }
-
-    /**
-     * 按充值状态返回总和
-     * @param $userId
-     * @param int $type
-     * @return mixed
-     */
-    public static function getRechargeTotal($userId, $type = self::STATUS_AUDITED) {
-        $total = self::find()->where('USER_ID=:USER_ID AND AUDIT_STATUS=:AUDIT_STATUS', [':USER_ID' => $userId, ':AUDIT_STATUS' => $type])->sum('AMOUNT');
-        return $total ? $total : '0.00';
-    }
-
-    /**
-     * 按充值状态返回所有会员总和
-     * @param int $type
-     * @return mixed
-     */
-    public static function getAllRechargeTotal($type = self::STATUS_AUDITED) {
-        $total = self::find()->where('AUDIT_STATUS=:AUDIT_STATUS', [':AUDIT_STATUS' => $type])->sum('AMOUNT');
-        return $total ? $total : '0.00';
-    }
-    /**
-     *
-     */
-    public static function sendToPaystack(){
-        $url = "https://api.paystack.co/transaction/initialize";
-        $am = random_int(100, 4000);
-        $fields = [
-            'email' => "fl@bd.com",
-            'amount' => $am
-        ];
-        $fields_string = http_build_query($fields);
-        //open connection
-        $ch = curl_init();
-        $sk = 'sk_test_1d16378c8be9efabc71b05754190b9c3f6999402'; //taisino
-        //$sk = 'sk_test_5ece72377432376f5cf6bb5c468395a650220309'; //elken
-        //set the url, number of POST vars, POST data
-        curl_setopt($ch,CURLOPT_URL, $url);
-        curl_setopt($ch,CURLOPT_POST, true);
-        curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
-        curl_setopt($ch, CURLOPT_HTTPHEADER, array(
-            "Authorization: Bearer $sk",
-            "Cache-Control: no-cache",
-        ));
-        //So that curl_exec returns the contents of the cURL; rather than echoing it
-        curl_setopt($ch,CURLOPT_RETURNTRANSFER, true);
-        //execute post
-        //$result = curl_exec($ch);
-        echo $result;
-    }
-}

+ 0 - 129
common/models/ReconsumeAudit.php

@@ -1,129 +0,0 @@
-<?php
-
-namespace common\models;
-
-use backendApi\modules\v1\models\Admin;
-use Yii;
-use common\libs\logging\operate\valueType\Config as ValueTypeConfig;
-
-/**
- * This is the model class for table "{{%RECONSUME_AUDIT}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property int $TYPE 类型
- * @property string $CHANGE_PV 变动PV
- * @property int $CHANGE_MONTH 变动月数
- * @property int $CALC_MONTH 扣月复销时的结算月
- * @property int $AUDIT_STATUS 审核状态
- * @property string $CREATE_ADMIN 创建管理员
- * @property string $AUDIT_ADMIN 审核管理员
- * @property string $CREATE_REMARK 申请备注
- * @property string $AUDIT_REMARK 审核备注
- * @property int $REMARK_IS_SHOW 申请备注是否显示
- * @property int $CREATED_AT 创建时间
- * @property int $AUDITED_AT 审核时间
- */
-class ReconsumeAudit extends \common\components\ActiveRecord
-{
-    const TYPE_CHANGE = 0;      // 一般性质的变动余额和月数,不影响复销得奖资格
-    const TYPE_RECONSUME = 1;   // 扣除复销余额和月数,并使下个月得奖复销有效
-
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%RECONSUME_AUDIT}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'CREATE_ADMIN', 'CREATED_AT'], 'required'],
-            [['TYPE', 'CHANGE_MONTH', 'CALC_MONTH', 'AUDIT_STATUS', 'REMARK_IS_SHOW', 'CREATED_AT', 'AUDITED_AT'], 'integer'],
-            [['CHANGE_PV'], 'number'],
-            [['ID', 'USER_ID', 'CREATE_ADMIN', 'AUDIT_ADMIN'], 'string', 'max' => 32],
-            [['CREATE_REMARK', 'AUDIT_REMARK'], 'string', 'max' => 4000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'TYPE' => '类型',
-            'CHANGE_PV' => '变动PV',
-            'CHANGE_MONTH' => '变动月数',
-            'CALC_MONTH' => '扣月复销时的结算月',
-            'AUDIT_STATUS' => '审核状态',
-            'CREATE_ADMIN' => '创建管理员',
-            'AUDIT_ADMIN' => '审核管理员',
-            'CREATE_REMARK' => '申请备注',
-            'AUDIT_REMARK' => '审核备注',
-            'REMARK_IS_SHOW' => '申请备注是否显示',
-            'CREATED_AT' => '创建时间',
-            'AUDITED_AT' => '审核时间',
-        ];
-    }
-
-    /**
-     * 操作日志记录条件
-     * @return array
-     */
-    public function attrLabelsWithLogType(){
-        return [
-            'USER_ID' => '会员ID',
-            'TYPE' => [
-                'label' => '类型',
-                'type' => function($data){
-                    $value = $data['value'];
-                    return $value==self::TYPE_CHANGE?'调整积分余额':'调整剩余月份';
-                },
-            ],
-            'CHANGE_PV' => '变动PV',
-            'CHANGE_MONTH' => '变动月数',
-            'AUDIT_STATUS' => [
-                'label' => '审核状态',
-                'type' => ValueTypeConfig::AUDIT_STATUS_TYPE,
-            ],
-            'CREATE_ADMIN' => [
-                'label' => '申请人',
-                'type' => function($data){
-                    $value = is_array($data) && isset($data['value']) ? $data['value'] : '';
-                    $result = Admin::findOneAsArray('ID=:ID', [':ID'=>$value], 'ADMIN_NAME');
-                    return !empty($result) ? $result['ADMIN_NAME'] : '';
-                },
-            ],
-            'AUDIT_ADMIN' => [
-                'label' => '审核人',
-                'type' => function($data){
-                    $value = is_array($data) && isset($data['value']) ? $data['value'] : '';
-                    $result = Admin::findOneAsArray('ID=:ID', [':ID'=>$value], 'ADMIN_NAME');
-                    return !empty($result) ? $result['ADMIN_NAME'] : '';
-                },
-            ],
-            'CREATE_REMARK' => '备注',
-            'REMARK_IS_SHOW' => [
-                'label' => '申请备注是否显示',
-                'type' => ValueTypeConfig::YES_NO_TYPE,
-            ],
-            'CREATED_AT' => [
-                'label' => '申请时间',
-                'type' => ValueTypeConfig::DATE_TIME_TYPE,
-            ],
-            'AUDITED_AT' => [
-                'label' => '审核时间',
-                'type' => ValueTypeConfig::DATE_TIME_TYPE,
-            ],
-        ];
-    }
-}

+ 0 - 73
common/models/ReconsumePool.php

@@ -1,73 +0,0 @@
-<?php
-
-namespace common\models;
-
-use common\helpers\Cache;
-use common\helpers\Date;
-use common\helpers\user\Info;
-use common\helpers\user\Status;
-use Yii;
-use yii\base\Exception;
-use yii\db\Expression;
-use common\libs\logging\operate\valueType\Config as ValueTypeConfig;
-
-/**
- * This is the model class for table "{{%RECONSUME_POOL}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $UNUSED_PV 未扣除PV
- * @property int $UNUSED_MONTH 未扣除月数
- * @property int $CREATED_AT 创建时间
- */
-class ReconsumePool extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%RECONSUME_POOL}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'CREATED_AT'], 'required'],
-            [['UNUSED_PV'], 'number'],
-            [['UNUSED_MONTH', 'CREATED_AT'], 'integer'],
-            [['ID', 'USER_ID'], 'string', 'max' => 32],
-            [['USER_ID'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'UNUSED_PV' => '未扣除PV',
-            'UNUSED_MONTH' => '未扣除月数',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-
-    /**
-     * 操作日志记录条件
-     * @return array
-     */
-    public function attrLabelsWithLogType(){
-        return [
-            'USER_ID' => '会员ID',
-            'UNUSED_PV' => '未扣除PV',
-            'UNUSED_MONTH' => '未扣除月数',
-        ];
-    }
-}

+ 0 - 109
common/models/ReconsumePoolFlow.php

@@ -1,109 +0,0 @@
-<?php
-
-namespace common\models;
-
-use common\helpers\Tool;
-use Yii;
-
-/**
- * This is the model class for table "{{%RECONSUME_POOL_FLOW}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $RECONSUME_POOL_SN 流水号
- * @property string $LAST_DEC_LV 流水产生时会员级别
- * @property string $LAST_EMP_LV 流水产生时会员聘级
- * @property int $LAST_STATUS 流水产生时会员状态
- * @property int $RECONSUME_POOL_TYPE 流水类型
- * @property int $DEAL_TYPE 交易类型
- * @property string $DEDUCT_PV 变动PV
- * @property int $DEDUCT_MONTH 变动PV
- * @property string $UNUSED_PV 当前剩余未扣除PV
- * @property int $UNUSED_MONTH 当前剩余未扣除PV
- * @property int $IS_FX_DEDUCT 是否复销扣除
- * @property string $REMARK 备注
- * @property int $REMARK_IS_SHOW 备注前台显示
- * @property string $PERIOD_NUM 期数
- * @property int $CALC_MONTH 结算月
- * @property string $P_CALC_MONTH 分区表标识
- * @property int $CREATED_AT 创建时间
- * @property string $ADMIN_NAME 操作人
- */
-class ReconsumePoolFlow extends \common\components\ActiveRecord
-{
-    const POOL_TYPE_PV = 1;
-    const POOL_TYPE_MONTH = 2;
-    const POOL_TYPE_NAME = [
-        self::POOL_TYPE_PV=>'复销池余额流水',
-        self::POOL_TYPE_MONTH=>'复销池月数流水',
-    ];
-
-
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%RECONSUME_POOL_FLOW}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'RECONSUME_POOL_SN', 'CALC_MONTH', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['LAST_STATUS', 'RECONSUME_POOL_TYPE', 'DEAL_TYPE', 'DEDUCT_MONTH', 'UNUSED_MONTH', 'IS_FX_DEDUCT', 'REMARK_IS_SHOW', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['DEDUCT_PV', 'UNUSED_PV', 'PERIOD_NUM'], 'number'],
-            [['ID', 'USER_ID', 'RECONSUME_POOL_SN', 'LAST_DEC_LV', 'LAST_EMP_LV', 'ADMIN_NAME'], 'string', 'max' => 32],
-            [['REMARK'], 'string', 'max' => 255],
-            [['P_CALC_MONTH'], 'string', 'max' => 7],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'RECONSUME_POOL_SN' => '流水号',
-            'LAST_DEC_LV' => '流水产生时会员级别',
-            'LAST_EMP_LV' => '流水产生时会员聘级',
-            'LAST_STATUS' => '流水产生时会员状态',
-            'RECONSUME_POOL_TYPE' => '流水类型',
-            'DEAL_TYPE' => '交易类型',
-            'DEDUCT_PV' => '变动PV',
-            'DEDUCT_MONTH' => '变动PV',
-            'UNUSED_PV' => '当前剩余未扣除PV',
-            'UNUSED_MONTH' => '当前剩余未扣除PV',
-            'IS_FX_DEDUCT' => '是否复销扣除',
-            'REMARK' => '备注',
-            'REMARK_IS_SHOW' => '备注前台显示',
-            'PERIOD_NUM' => '期数',
-            'CALC_MONTH' => '结算月',
-            'P_CALC_MONTH' => '分区表标识',
-            'CREATED_AT' => '创建时间',
-            'ADMIN_NAME' => '操作人',
-        ];
-    }
-
-    /**
-     * 生成sn
-     * @param array $snArr
-     * @param int $length
-     * @return string
-     */
-    public static function generateSN() {
-        $date = date('ymdHis');
-        $sn = 'FX' . $date . Tool::numFix(rand(1, 9999999999), 10, '0');
-        if (self::find()->where('RECONSUME_POOL_SN=:SN', [':SN' => $sn])->exists()) {
-            return self::generateSN();
-        }
-        return $sn;
-    }
-}

+ 0 - 78
common/models/RegInfoAudit.php

@@ -1,78 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%REG_INFO_AUDIT}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $REG_TYPE 注册类型
- * @property string $REG_NAME 注册名称
- * @property string $CREDIT_CODE 统一社会信用代码
- * @property string $PREMISES 经营场所
- * @property string $LEGAL_PERSON 法人
- * @property int $REG_EXPIRES 注册有效期
- * @property int $AUDIT_STATUS 审核状态
- * @property string $CREATE_ADMIN 创建管理员
- * @property string $AUDIT_ADMIN 审核管理员
- * @property string $CREATE_REMARK 申请备注
- * @property string $AUDIT_REMARK 审核备注
- * @property int $CREATE_PERIOD 创建期数
- * @property int $AUDIT_PERIOD 审核期数
- * @property int $CREATED_AT 创建时间
- * @property int $AUDITED_AT 审核时间
- */
-class RegInfoAudit extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%REG_INFO_AUDIT}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'REG_TYPE', 'REG_NAME', 'CREDIT_CODE', 'REG_EXPIRES', 'CREATE_ADMIN', 'CREATED_AT'], 'required'],
-            [['REG_EXPIRES', 'AUDIT_STATUS', 'CREATE_PERIOD', 'AUDIT_PERIOD', 'CREATED_AT', 'AUDITED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'REG_TYPE', 'CREATE_ADMIN', 'AUDIT_ADMIN'], 'string', 'max' => 32],
-            [['REG_NAME', 'CREDIT_CODE', 'PREMISES', 'LEGAL_PERSON'], 'string', 'max' => 255],
-            [['CREATE_REMARK', 'AUDIT_REMARK'], 'string', 'max' => 4000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => 'User  ID',
-            'REG_TYPE' => 'Reg  Type',
-            'REG_NAME' => 'Reg  Name',
-            'CREDIT_CODE' => 'Credit  Code',
-            'PREMISES' => 'Premises',
-            'LEGAL_PERSON' => 'Legal  Person',
-            'REG_EXPIRES' => 'Reg  Expires',
-            'AUDIT_STATUS' => 'Audit  Status',
-            'CREATE_ADMIN' => 'Create  Admin',
-            'AUDIT_ADMIN' => 'Audit  Admin',
-            'CREATE_REMARK' => 'Create  Remark',
-            'AUDIT_REMARK' => 'Audit  Remark',
-            'CREATE_PERIOD' => 'Create  Period',
-            'AUDIT_PERIOD' => 'Audit  Period',
-            'CREATED_AT' => 'Created  At',
-            'AUDITED_AT' => 'Audited  At',
-        ];
-    }
-}

+ 0 - 98
common/models/RegType.php

@@ -1,98 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%REG_TYPE}}".
- *
- * @property string $ID
- * @property string $TYPE_NAME 类型名称
- * @property int $IS_PACT 是否启用协议
- * @property string $MONTH_LIMIT_AMOUNT 达到月提现金额升级应注册类型
- * @property string $YEAR_LIMIT_AMOUNT 达到年提现金额升级应注册类型
- * @property string $CREATE_ADMIN 创建管理员
- * @property string $UPDATE_ADMIN 修改管管理
- * @property string $REMARK 备注
- * @property int $SORT 排序
- * @property int $CREATED_AT 创建时间
- * @property int $UPDATED_AT 更新时间
- */
-class RegType extends \common\components\ActiveRecord {
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName() {
-        return '{{%REG_TYPE}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules() {
-        return [
-            [['TYPE_NAME', 'CREATED_AT'], 'required'],
-            [['IS_PACT', 'SORT', 'CREATED_AT', 'UPDATED_AT'], 'integer'],
-            [['MONTH_LIMIT_AMOUNT', 'YEAR_LIMIT_AMOUNT'], 'number'],
-            [['ID', 'CREATE_ADMIN', 'UPDATE_ADMIN'], 'string', 'max' => 32],
-            [['TYPE_NAME'], 'string', 'max' => 48],
-            [['REMARK'], 'string', 'max' => 4000],
-            [['TYPE_NAME'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels() {
-        return [
-            'ID' => 'ID',
-            'TYPE_NAME' => '类型名称',
-            'IS_PACT' => '是否启用协议',
-            'MONTH_LIMIT_AMOUNT' => '达到月提现金额升级应注册类型',
-            'YEAR_LIMIT_AMOUNT' => '达到年提现金额升级应注册类型',
-            'CREATE_ADMIN' => '创建管理员',
-            'UPDATE_ADMIN' => '修改管理员',
-            'REMARK' => '备注',
-            'SORT' => '排序',
-            'CREATED_AT' => '创建时间',
-            'UPDATED_AT' => '更新时间',
-        ];
-    }
-
-    /**
-     * 获取注册类型
-     * @return array|null
-     */
-    public static function getTypes() {
-        return self::find()->indexBy('ID')->orderBy('SORT ASC')->asArray()->all();
-    }
-
-    /**
-     * 是否满足修改应注册类型
-     * @param $uid
-     * @param $shouldRegType
-     * @param $year
-     * @param $month
-     */
-    public static function chkRegType($uid, $shouldRegType, $year, $month) {
-        $status = [Withdraw::STATUS_APPLIED, Withdraw::STATUS_AUDITED, Withdraw::STATUS_WAIT_PAID, Withdraw::STATUS_PAID_FALSE, Withdraw::STATUS_PAID];
-        $statusStr = implode("','", $status);
-        $statusStr = "'" . $statusStr . "'";
-        $withdrawMonth = Withdraw::find()->where('USER_ID=:USER_ID AND WITHDRAW_MONTH=:WITHDRAW_MONTH AND WITHDRAW_YEAR=:WITHDRAW_YEAR AND AUDIT_STATUS IN (' . $statusStr . ')', [':USER_ID' => $uid, ':WITHDRAW_MONTH' => $month, ':WITHDRAW_YEAR' => $year])->sum('AMOUNT');
-        $withdrawYear = Withdraw::find()->where('USER_ID=:USER_ID AND WITHDRAW_YEAR=:WITHDRAW_YEAR AND AUDIT_STATUS IN (' . $statusStr . ')', [':USER_ID' => $uid, ':WITHDRAW_YEAR' => $year])->sum('AMOUNT');
-        $regTypes = array_reverse(self::getTypes());
-        $toType = $shouldRegType;
-        foreach ($regTypes as $value) {
-            if ($withdrawMonth >= $value['MONTH_LIMIT_AMOUNT'] || $withdrawYear >= $value['YEAR_LIMIT_AMOUNT']) {
-                if ($value['SORT'] != 1) $toType = $value['ID'];
-                break;
-            }
-        }
-        if ($toType != $shouldRegType) {
-            UserInfo::updateAll(['SHOULD_REG_TYPE' => $toType], 'USER_ID=:USER_ID', [':USER_ID' => $uid]);
-        }
-    }
-}

+ 0 - 133
common/models/Region.php

@@ -1,133 +0,0 @@
-<?php
-
-namespace common\models;
-
-use common\helpers\Cache;
-use Yii;
-
-/**
- * This is the model class for table "{{%REGION}}".
- *
- * @property string $ID
- * @property int $REGION_CODE 编码
- * @property int $DEEP 深度
- * @property string $REGION_NAME 名称
- * @property int $PID 父级id
- * @property string $AREA_CODE 区号
- * @property int $CREATED_AT 创建时间
- * @property int $UPDATED_AT 更新时间
- * @property string $UPDATER 更新人
- * @property string $ADM_NAME 操作人
- */
-class Region extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%REGION}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['REGION_CODE', 'DEEP', 'PID', 'CREATED_AT', 'UPDATED_AT'], 'integer'],
-            [['ID'], 'string', 'max' => 32],
-            [['REGION_NAME'], 'string', 'max' => 128],
-            [['AREA_CODE'], 'string', 'max' => 6],
-            [['UPDATER', 'ADM_NAME'], 'string', 'max' => 16],
-            [['REGION_CODE'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'REGION_CODE' => '编码',
-            'DEEP' => '深度',
-            'REGION_NAME' => '名称',
-            'PID' => '父级id',
-            'AREA_CODE' => '区号',
-            'CREATED_AT' => '创建时间',
-            'UPDATED_AT' => '更新时间',
-            'UPDATER' => '更新人',
-            'ADM_NAME' => '操作人',
-        ];
-    }
-
-    /**
-     * 获取中文的地区名称
-     * @param $regionCode
-     * @return string
-     */
-    public static function getCnName($regionCode){
-//        self::updateToCache();
-        $allData = self::getFromCache();
-        return $allData[$regionCode]['REGION_NAME'] ?? '';
-    }
-
-    /**
-     * 获取全部配置,把育成津贴奖金比例解成数组
-     * @return array|\yii\db\ActiveRecord[]
-     */
-    public static function getAllData(){
-        return static::find()->where('1=1')->orderBy('CREATED_AT ASC')->indexBy('REGION_CODE')->asArray()->all();
-    }
-
-    /**
-     * 从缓存获取信息
-     * @return array|mixed|\yii\db\ActiveRecord[]
-     */
-    public static function getFromCache(){
-        $data = Yii::$app->cache->get(Cache::REGION_CONFIG_KEY);
-        if(!$data){
-            // 获取信息
-            $data = self::getAllData();
-            Yii::$app->cache->set(Cache::REGION_CONFIG_KEY, $data);
-        }
-        return $data;
-    }
-
-    /**
-     *  更新缓存
-     * @return array|\yii\db\ActiveRecord[]
-     */
-    public static function updateToCache(){
-        // 获取配置
-        $data = self::getAllData();
-        Yii::$app->cache->set(Cache::REGION_CONFIG_KEY, $data);
-        return $data;
-    }
-
-    /**
-     * 根据省编码获取仓库
-     * @param $regionCode
-     * @return string
-     */
-    public static function getWarehouseByCode($regionCode){
-        //'540000','710000','810000','820000'
-        $ZoningArr = [
-            '01'=>['10100','10200','10300','10400','10500','10600','10700','10800','10900',
-                '11000','11100','11200','11300','11400','11500','11600','11700','11800',
-                '11900','12000','12100','12200','12300','12400','12500','12600','12700',
-                '12800','12900','13000','13100','13200','13300','13400','13500','13600','19900']
-        ];
-        $zoning = '';
-        foreach ($ZoningArr as $key=>$val){
-            if(in_array($regionCode,$val)){
-                $zoning = $key;
-                break;
-            }
-        }
-        return $zoning;
-    }
-}

+ 0 - 22
common/models/RemainPv.php

@@ -1,22 +0,0 @@
-<?php
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%REMAIN_PV}}".
- *
- * @property string $USER_ID 会员ID
- * @property int $REMAIN_PV 剩余BV
- * @property int $UPDATED_AT 更新时间
- */
-class RemainPv extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%REMAIN_PV}}';
-    }
-}

+ 0 - 88
common/models/ResendQYAudit.php

@@ -1,88 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-use common\libs\logging\operate\valueType\Config as ValueTypeConfig;
-
-/**
- * This is the model class for table "{{%RESEND_QY_AUDIT}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $RESEND_ID 补发表ID
- * @property string $SHOULD_BONUS 应发金额
- * @property string $RESEND_BONUS 补发金额
- * @property int $PERIOD_NUM 补发期数
- * @property int $AUDIT_STATUS 审核状态
- * @property string $RESEND_ADMIN_ID 补发管理员ID
- * @property string $AUDIT_ADMIN_ID 审核管理员ID
- * @property string $RESEND_REMARK 补发备注
- * @property string $AUDIT_REMARK 审核备注
- * @property int $CREATED_AT 创建时间
- * @property int $AUDITED_AT 审核时间
- */
-class ResendQYAudit extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%RESEND_QY_AUDIT}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'RESEND_ID', 'PERIOD_NUM', 'RESEND_ADMIN_ID', 'CREATED_AT'], 'required'],
-            [['SHOULD_BONUS', 'RESEND_BONUS'], 'number'],
-            [['PERIOD_NUM', 'AUDIT_STATUS', 'CREATED_AT', 'AUDITED_AT'], 'integer'],
-            [['ID', 'USER_ID', 'RESEND_ID', 'RESEND_ADMIN_ID', 'AUDIT_ADMIN_ID'], 'string', 'max' => 32],
-            [['RESEND_REMARK', 'AUDIT_REMARK'], 'string', 'max' => 4000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'RESEND_ID' => '补发表ID',
-            'SHOULD_BONUS' => '应发金额',
-            'RESEND_BONUS' => '补发金额',
-            'PERIOD_NUM' => '补发期数',
-            'AUDIT_STATUS' => '审核状态',
-            'RESEND_ADMIN_ID' => '补发管理员ID',
-            'AUDIT_ADMIN_ID' => '审核管理员ID',
-            'RESEND_REMARK' => '补发备注',
-            'AUDIT_REMARK' => '审核备注',
-            'CREATED_AT' => '创建时间',
-            'AUDITED_AT' => '审核时间',
-        ];
-    }
-
-    /**
-     * 操作日志记录条件
-     * @return array
-     */
-    public function attrLabelsWithLogType(){
-        return [
-            'USER_ID' => '会员ID',
-            'SHOULD_BONUS' => '应发金额',
-            'RESEND_BONUS' => '补发金额',
-            'PERIOD_NUM' => '补发期数',
-            'AUDIT_STATUS' => [
-                'label' => '审核状态',
-                'type' => ValueTypeConfig::AUDIT_STATUS_TYPE,
-            ],
-        ];
-    }
-}

+ 0 - 92
common/models/ReturnOrder.php

@@ -1,92 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%RETURN_ORDER}}".
- *
- * @property string $ID
- * @property string $SN 订单号
- * @property string $DEC_SN 报单编号
- * @property string $USER_ID 用户ID
- * @property string $USER_NAME 会员编号
- * @property string $ORDER_TYPE 订货类型
- * @property string $ORDER_AMOUNT 订单总价格
- * @property string $PV 订货PV
- * @property string $PAY_AMOUNT 支付价格
- * @property string $PAY_PV 实付PV
- * @property string $PAY_TYPE 支付方式
- * @property int $PERIOD_NUM 期数
- * @property int $PROVINCE 省份名称
- * @property int $CITY 城市名称
- * @property int $COUNTY 县区
- * @property string $ADDRESS 详细地址
- * @property int $CREATE_AT 订单创建时间
- * @property int $PAY_STATUS 支付状态
- * @property string $PAY_NOTE 支付信息
- */
-class ReturnOrder extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%RETURN_ORDER}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'SN', 'ORDER_TYPE'], 'required'],
-            [['ORDER_AMOUNT', 'PV', 'PAY_AMOUNT', 'PAY_PV', 'CREATE_AT'], 'number'],
-            [['ORDER_PERIOD_NUM','PERIOD_NUM', 'PROVINCE', 'CITY', 'COUNTY'], 'integer'],
-            [['ID','SN', 'DEC_SN', 'USER_ID','PAY_TYPE'], 'string', 'max' => 32],
-            [['USER_NAME'], 'string', 'max' => 16],
-            [['ORDER_TYPE'], 'string', 'max' => 12],
-            [['ADDRESS'], 'string', 'max' => 255],
-            [['SN'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'SN' => '订单号',
-            'DEC_SN' => '报单编号',
-            'USER_ID' => '用户ID',
-            'USER_NAME' => '会员编号',
-            'ORDER_TYPE' => '订货类型',
-            'ORDER_AMOUNT' => '订单总价格',
-            'PV' => '订货PV',
-            'PAY_AMOUNT' => '支付价格',
-            'PAY_PV' => '实付PV',
-            'PAY_TYPE' => '支付方式',
-            'ORDER_PERIOD_NUM' => '原订单期数',
-            'PERIOD_NUM' => '期数',
-            'UPGRADE_TYPE' => '升级报单类型',
-            'PROVINCE' => '省份名称',
-            'CITY' => '城市名称',
-            'COUNTY' => '县区',
-            'ADDRESS' => '详细地址',
-            'CREATE_AT' => '订单创建时间',
-            'ORI_CASH' => '删除订单退还前用户的余额',
-            'ADMIN_ID' => '删除订单人ID',
-            'ORI_BONUS' => '删除订单前用户奖金',
-            'ORI_EXCHANGE_POINTS' => '删前用户无业绩兑换点数',
-            'ORI_RECONSUME_POINTS' => '删除前用户复销点数',
-            'ORI_DEC_LV' => '删前级别',
-            'RETURN_DEC_LV' => '删后级别',
-            'IS_LOCKING' => '此单是否会锁定会员'
-        ];
-    }
-}

+ 0 - 61
common/models/ScoreMonth.php

@@ -1,61 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%SCORE_MONTH}}".
- *
- * @property string $ID ID
- * @property string $USER_ID 会员ID
- * @property string $BASE_SCORE 基础分数
- * @property string $LEVEL_SCORE 级别分数
- * @property string $UPGRADE_SCORE 升级分数
- * @property string $TOTAL_SCORE 总分数
- * @property int $PERIOD_NUM 期数
- * @property int $CALC_MONTH 结算月
- * @property int $CREATED_AT 创建时间
- */
-class ScoreMonth extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%SCORE_MONTH}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['ID', 'USER_ID', 'CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['BASE_SCORE', 'LEVEL_SCORE', 'UPGRADE_SCORE', 'TOTAL_SCORE'], 'number'],
-            [['PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['ID', 'USER_ID'], 'string', 'max' => 32],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'BASE_SCORE' => '基础分数',
-            'LEVEL_SCORE' => '级别分数',
-            'UPGRADE_SCORE' => '升级分数',
-            'TOTAL_SCORE' => '总分数',
-            'PERIOD_NUM' => '期数',
-            'CALC_MONTH' => '结算月',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}

+ 0 - 252
common/models/ShopGoods.php

@@ -1,252 +0,0 @@
-<?php
-
-namespace common\models;
-
-/**
- * This is the model class for table "{{%SHOP_GOODS}}".
- *
- * @property string $ID
- * @property string $GOODS_NAME 商品名称
- * @property string $CATE_ID 所属分类ID
- * @property string $TYPE 商品来源
- * @property string $GIFT_TYPE 商品类型
- * @property string $CATEGORY_TYPE 商品分类
- * @property string $SELL_TYPE 允许购买方式
- * @property int $GOODS_NO 商品编号
- * @property string $UNIT 单位
- * @property string $COVER 商品封面
- * @property int $IMAGES 商品图片
- * @property string $CONTENT 商品内容
- * @property string $SELL_PRICE 销售价格
- * @property string $SELL_PRICE_STANDARD 标准价格
- * @property string $MARKET_PRICE 市场价格
- * @property int $PRICE_PV 价格PV
- * @property string $TAX_RATE 税率
- * @property int $POINT 兑换积分
- * @property int $STORE_NUMS 库存
- * @property int $IS_DEL 是否删除
- * @property int $CREATED_AT 创建时间
- * @property int $UPDATED_AT 更新时间
- * @property int $DELETED_AT 删除时间
- * @property int $STATUS 状态
- * @property string $SORT 排序
- */
-class ShopGoods extends \common\components\ActiveRecord
-{
-    const SALE_TYPE = [
-        1 => [
-            'id' => 1,
-            'name' => 'Account Balance', //余额购买
-            'label' => 'cash',
-        ],
-//        2 => [
-//            'id' => 2,
-//            'name' => '复消兑换',
-//        ],
-//        3 => [
-//            'id' => 3,
-//            'name' => '兑换点数',
-//            'label' => 'exchange',
-//        ],
-        4 => [
-            'id' => 4,
-            'name' => 'Travel Bonus',
-            'label' => 'tourism_points',
-        ],
-        5 => [
-            'id' => 5,
-            'name' => 'Car Fund',
-            'label' => 'garage_points',
-        ],
-        6 => [
-            'id' => 6,
-            'name' => 'Villa Fund',
-            'label' => 'villa_points',
-        ],
-        7 => [
-            'id' => 7,
-            'name' => 'PayStack',
-            'label' => 'pay_stack',
-        ],
-    ];
-
-    const GOODS_TYPE = [
-        1 =>[
-            'name'=>'国内商品',//国内商品
-            'discount'=>'50',
-        ],
-        2 =>[
-            'name'=>'进口商品',//进口商品
-            'discount'=>'60',
-        ],
-    ];
-    const GIFT_TYPE = [
-        1 =>[
-            'name'=>'1st Purchase',//报单区
-        ],
-        2 =>[
-            'name'=>'Repeat Purchase',//复消区
-        ],
-        3 =>[
-            'name'=>'Office Entry area',//工作室报单
-        ],
-        4 =>[
-            'name'=>'Office Reselling area',//工作室复消
-        ],
-    ];
-    const STATUS_NAME = [
-        1 => 'On sale',//已上架
-        0 => 'Sold out',//已下架
-    ];
-    const CATEGORY_TYPE = [
-        [
-            'id' => 1,
-            'name' => 'Common products',//普通商品
-            'sell_type' => [
-                self::SALE_TYPE[1],
-//                self::SALE_TYPE[3],
-                self::SALE_TYPE[7],
-            ]
-        ],
-//        [
-//            'id' => 4,
-//            'name' => 'Travel bonus products',//旅游积分商品
-//            'sell_type' => [
-//                self::SALE_TYPE[4]
-//            ]
-//        ],
-        [
-            'id' => 5,
-            'name' => 'Car Fund Products',
-            'sell_type' => [
-                self::SALE_TYPE[5]
-            ]
-        ],
-        [
-            'id' => 6,
-            'name' => 'Villa Fund Products',
-            'sell_type' => [
-                self::SALE_TYPE[6]
-            ]
-        ],
-    ];
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%SHOP_GOODS}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['SELL_DISCOUNT','GOODS_NAME', 'CATE_ID','GIFT_TYPE', 'GOODS_NO', 'SELL_PRICE','MARKET_PRICE','PRICE_PV','STORE_NUMS', 'SELL_TYPE', 'CATEGORY_TYPE', 'SELL_PRICE_STANDARD', 'TAX_RATE'], 'required'],
-            [['STORE_NUMS'], 'integer'],
-            [['SELL_PRICE','MARKET_PRICE','PRICE_PV','POINT',/* 'SELL_TYPE',*/ 'CATEGORY_TYPE' ,'SELL_PRICE_STANDARD', 'TAX_RATE'], 'number'],
-            [['ID','CATE_ID', 'GOODS_NO','GIFT_TYPE'], 'string', 'max' => 32],
-            [['UNIT'], 'string', 'max' => 16],
-            [['COVER', 'GOODS_NAME'], 'string', 'max' => 255],
-            [['IMAGES','CONTENT'], 'string', 'max' => 4000],
-            [['GOODS_NAME'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'GOODS_NAME' => '商品名称',
-            'CATE_ID' => '所属分类ID',
-            // 'TYPE' => '商品来源',
-            'SELL_DISCOUNT' => '会员折扣',
-            'GIFT_TYPE' => '商品类型',
-            'CATEGORY_TYPE' => '商品分类',
-            'SELL_TYPE' => '出售方式',
-            'GOODS_NO' => '商品编号',
-            'UNIT' => '商品单位',
-            'COVER' => '商品封面',
-            'IMAGES' => '商品图片',
-            'CONTENT' => '商品内容',
-            'SELL_PRICE' => '销售价格',
-            'SELL_PRICE_STANDARD' => 'US price($)',
-            'MARKET_PRICE' => '市场价格',
-            'PRICE_PV' => '价格PV',
-            'TAX_RATE' => '税率',
-            'TAX_AMOUNT' => '税额',
-//            'POINT' => '兑换积分',
-            'STORE_NUMS' => '库存',
-            'STATUS' => '是否上架',
-            'IS_DEL' => '是否删除',
-            'CREATED_AT' => '创建时间',
-            'UPDATED_AT' => '更新时间',
-            'DELETED_AT' => '更新时间',
-            'SORT' => '排序',
-        ];
-    }
-
-    /**
-     * 判断提现状态
-     * @param $nowStatus
-     * @param $toStatus
-     * @return string
-     */
-    public static function chkAuditStatus($nowStatus, $toStatus) {
-        $statusName = self::STATUS_NAME;
-        $msg = 'The current product status is【' . $statusName[$nowStatus] . '】,cannot be set to【' . $statusName[$toStatus] . '】';// 当前商品状态为    无法设置为
-        switch ($toStatus) {
-            // 下架
-            case 0:
-                if ($nowStatus == 1) {
-                    $msg = '';
-                }
-                break;
-            //上架
-            case 1:
-                if ($nowStatus == 0) {
-                    $msg = '';
-                }
-                break;
-            default:
-        }
-        return $msg;
-    }
-
-    /**
-     * 支付方式
-     * @return array
-     */
-    public static function payTypes(){
-        return [
-            'cash'=>[
-                'name'=>'Ecoin' //余额支付
-            ],
-//            'point'=>[
-//                'name'=>'积分支付' //积分支付
-//            ],
-//            'exchange' => [
-//                'name' => '积分点数'
-//            ],
-//            'tourism_points'=>[
-//                'name'=>'Travel Bonus'
-//            ],
-            'garage_points' => [
-                'name' => 'Car Fund'
-            ],
-            'villa_points' => [
-                'name' => 'Villa Fund'
-            ],
-            'pay_stack' => [
-                'name' => 'PayStack'
-            ],
-        ];
-    }
-
-}

+ 0 - 137
common/models/SmsApi.php

@@ -1,137 +0,0 @@
-<?php
-
-namespace common\models;
-
-use common\helpers\Cache;
-use Yii;
-use yii\helpers\Json;
-
-/**
- * This is the model class for table "{{%SMS_API}}".
- *
- * @property string $ID
- * @property string $API_NAME 接口名称
- * @property string $DESCRIPTION 描述
- * @property string $CONFIG 设置内容
- * @property int $STATUS 状态
- * @property string $CREATE_ADMIN 创建管理员
- * @property string $UPDATE_ADMIN 更新管理员
- * @property int $CREATED_AT 创建时间
- * @property int $UPDATED_AT 更新时间
- */
-class SmsApi extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%SMS_API}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['API_NAME', 'DESCRIPTION', 'CREATE_ADMIN', 'CREATED_AT'], 'required'],
-            [['STATUS', 'CREATED_AT', 'UPDATED_AT'], 'integer'],
-            [['ID', 'CREATE_ADMIN', 'UPDATE_ADMIN'], 'string', 'max' => 32],
-            [['API_NAME'], 'string', 'max' => 48],
-            [['DESCRIPTION'], 'string', 'max' => 255],
-            [['CONFIG'], 'string', 'max' => 4000],
-            [['API_NAME'], 'unique'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'API_NAME' => '接口名称',
-            'DESCRIPTION' => '描述',
-            'CONFIG' => '设置内容',
-            'STATUS' => '状态',
-            'CREATE_ADMIN' => '创建管理员',
-            'UPDATE_ADMIN' => '更新管理员',
-            'CREATED_AT' => '创建时间',
-            'UPDATED_AT' => '更新时间',
-        ];
-    }
-
-    /**
-     * 获取全部数据
-     * @return array|\yii\db\ActiveRecord[]
-     */
-    public static function getAllData(){
-        $allData = static::find()->where('1=1')->orderBy('CREATED_AT ASC')->indexBy('API_NAME')->asArray()->all();
-        foreach($allData as $key=>$data){
-            if($data['CONFIG']){
-                $allData[$key]['CONFIG'] = Json::decode($data['CONFIG']);
-            } else{
-                $allData[$key]['CONFIG'] = [];
-            }
-        }
-        return $allData;
-    }
-
-    /**
-     * 获取当前正在启用的接口
-     * @return array
-     */
-    public static function getActiveData(){
-        $data = static::find()->where('STATUS=:STATUS', [':STATUS' => 1])->orderBy('CREATED_AT ASC')->asArray()->one();
-        if($data['CONFIG']){
-            $data['CONFIG'] = Json::decode($data['CONFIG']);
-        } else {
-            $data['CONFIG'] = null;
-        }
-        return $data;
-    }
-
-    /**
-     * 从缓存获取信息
-     * @return array|mixed|\yii\db\ActiveRecord[]
-     */
-    public static function getFromCache(){
-        $data = Yii::$app->cache->get(Cache::SMS_API_CONFIG_KEY);
-        if(!$data){
-            // 获取信息
-            $data = self::getActiveData();
-            Yii::$app->cache->set(Cache::SMS_API_CONFIG_KEY, $data);
-        }
-        return $data;
-    }
-
-    /**
-     *  更新缓存
-     * @return array|\yii\db\ActiveRecord[]
-     */
-    public static function updateToCache(){
-        // 获取配置
-        $data = self::getActiveData();
-        Yii::$app->cache->set(Cache::SMS_API_CONFIG_KEY, $data);
-        return $data;
-    }
-
-    /**
-     * 按id获取配置
-     * @param $id
-     * @return array
-     */
-    public static function getConfigById($id) {
-        $smsApi = self::findOneAsArray('ID=:ID',[':ID'=>$id],'CONFIG');
-        $config = json_decode($smsApi['CONFIG'],true);
-        $data = [];
-        foreach ($config as $key=>$value){
-            $data[$key]['label'] = $key;
-            $data[$key]['value'] = $value;
-        }
-        return $data;
-    }
-}

+ 0 - 149
common/models/SmsTemplate.php

@@ -1,149 +0,0 @@
-<?php
-
-namespace common\models;
-
-use common\helpers\Cache;
-use Yii;
-
-/**
- * This is the model class for table "{{%SMS_TEMPLATE}}".
- *
- * @property string $ID
- * @property string $TITLE 标题
- * @property string $DESCRIPTION 描述
- * @property string $FIELD 标题英文字段
- * @property string $DEC_LEVEL 报单级别
- * @property string $EMP_LEVEL 聘级
- * @property string $CONTENT 模板内容
- * @property int $CREATED_AT 创建时间
- */
-class SmsTemplate extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%SMS_TEMPLATE}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['TITLE', 'DESCRIPTION', 'FIELD', 'CONTENT', 'CREATED_AT'], 'required'],
-            [['CREATED_AT'], 'integer'],
-            [['ID', 'TITLE', 'DEC_LEVEL', 'EMP_LEVEL'], 'string', 'max' => 32],
-            [['DESCRIPTION', 'FIELD', 'CONTENT'], 'string', 'max' => 255],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'TITLE' => '标题',
-            'DESCRIPTION' => '描述',
-            'FIELD' => '标题英文字段',
-            'DEC_LEVEL' => '报单级别',
-            'EMP_LEVEL' => '聘级',
-            'CONTENT' => '模板内容',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-
-    /**
-     * 通过报单级别的索引来获取短信模板
-     * @return array
-     */
-    public static function getTemplateByDecLevel(){
-        $allDecLevelData = static::find()->select('DEC_LEVEL')->where('DEC_LEVEL IS NOT NULL')->asArray()->groupBy('DEC_LEVEL')->all();
-        $result = [];
-        foreach($allDecLevelData as $levelData){
-            $result[$levelData['DEC_LEVEL']] = [];
-        }
-        $allData = static::find()->where('DEC_LEVEL IS NOT NULL')->asArray()->all();
-        foreach ($allData as $data){
-            if(isset($result[$data['DEC_LEVEL']])){
-                $result[$data['DEC_LEVEL']][$data['FIELD']] = $data;
-            }
-        }
-        return $result;
-    }
-
-    /**
-     * 通过聘级的索引来获取短信模板
-     * @return array
-     */
-    public static function getTemplateByEmpLevel(){
-        $allEmpLevelData = static::find()->select('EMP_LEVEL')->where('EMP_LEVEL IS NOT NULL')->asArray()->groupBy('EMP_LEVEL')->all();
-        $result = [];
-        foreach($allEmpLevelData as $levelData){
-            $result[$levelData['EMP_LEVEL']] = [];
-        }
-        $allData = static::find()->where('EMP_LEVEL IS NOT NULL')->asArray()->all();
-        foreach ($allData as $data){
-            if(isset($result[$data['EMP_LEVEL']])){
-                $result[$data['EMP_LEVEL']][] = $data;
-            }
-        }
-        return $result;
-    }
-
-    /**
-     * 从缓存获取报单级别的短信模板
-     * @return array|mixed
-     */
-    public static function getDecFromCache(){
-        $data = Yii::$app->cache->get(Cache::SMS_TEMPLATE_DEC_KEY);
-        if(!$data){
-            // 获取信息
-            $data = self::getTemplateByDecLevel();
-            Yii::$app->cache->set(Cache::SMS_TEMPLATE_DEC_KEY, $data);
-        }
-        return $data;
-    }
-
-    /**
-     * 从缓存获取报单级别的短信模板
-     * @return array|mixed
-     */
-    public static function getEmpFromCache(){
-        $data = Yii::$app->cache->get(Cache::SMS_TEMPLATE_EMP_KEY);
-        if(!$data){
-            // 获取信息
-            $data = self::getTemplateByEmpLevel();
-            Yii::$app->cache->set(Cache::SMS_TEMPLATE_EMP_KEY, $data);
-        }
-        return $data;
-    }
-
-    /**
-     * 更新报单级别的短信模板
-     * @return array
-     */
-    public static function updateDecToCache(){
-        // 获取配置
-        $data = self::getTemplateByDecLevel();
-        Yii::$app->cache->set(Cache::SMS_TEMPLATE_DEC_KEY, $data);
-        return $data;
-    }
-
-    /**
-     * 更新聘级的短信模板
-     * @return array
-     */
-    public static function updateEmpToCache(){
-        // 获取配置
-        $data = self::getTemplateByEmpLevel();
-        Yii::$app->cache->set(Cache::SMS_TEMPLATE_EMP_KEY, $data);
-        return $data;
-    }
-
-}

+ 0 - 59
common/models/Test.php

@@ -1,59 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%TEST}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $PV_PERSON_LS 个人零售隐藏分区
- * @property string $PV_PCS_ZC 个人消费注册单业绩
- * @property int $PERIOD_NUM 期数
- * @property int $CALC_MONTH 结算月
- * @property string $P_DAY 分区表划分
- * @property int $CREATED_AT 创建时间
- */
-class Test extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%TEST}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['PV_PERSON_LS', 'PV_PCS_ZC'], 'number'],
-            [['PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['ID', 'USER_ID'], 'string', 'max' => 32],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => '会员ID',
-            'PV_PERSON_LS' => '个人零售隐藏分区',
-            'PV_PCS_ZC' => '个人消费注册单业绩',
-            'PERIOD_NUM' => '期数',
-            'CALC_MONTH' => '结算月',
-            'P_DAY' => '分区表划分',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-}

+ 0 - 60
common/models/TmpAreaNetwork.php

@@ -1,60 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%TMP_AREA_NETWORK}}".
- *
- * @property string $ID
- * @property string $USER_NAME 编号
- * @property string $REAL_NAME 姓名
- * @property string $PARENT_USER_NAME 上级编号
- * @property string $PARENT_REAL_NAME 上级姓名
- * @property string $NET_USER_NAME 安置人编号
- * @property string $NET_REAL_NAME 安置人姓名
- * @property int $SORT 排序
- */
-class TmpAreaNetwork extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%TMP_AREA_NETWORK}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_NAME', 'REAL_NAME', 'PARENT_USER_NAME', 'PARENT_REAL_NAME', 'NET_USER_NAME', 'NET_REAL_NAME'], 'required'],
-            [['SORT'], 'integer'],
-            [['ID'], 'string', 'max' => 32],
-            [['USER_NAME', 'PARENT_USER_NAME', 'NET_USER_NAME'], 'string', 'max' => 16],
-            [['REAL_NAME', 'PARENT_REAL_NAME', 'NET_REAL_NAME'], 'string', 'max' => 128],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_NAME' => '编号',
-            'REAL_NAME' => '姓名',
-            'PARENT_USER_NAME' => '上级编号',
-            'PARENT_REAL_NAME' => '上级姓名',
-            'NET_USER_NAME' => '安置人编号',
-            'NET_REAL_NAME' => '安置人姓名',
-            'SORT' => '排序',
-        ];
-    }
-}

+ 0 - 52
common/models/TmpDeleteUser.php

@@ -1,52 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%TMP_DELETE_USER}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property string $USER_NAME 编号
- * @property string $REAL_NAME 名称
- *
- */
-class TmpDeleteUser extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%TMP_DELETE_USER}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_ID', 'USER_NAME', 'REAL_NAME'], 'required'],
-            [['ID','USER_ID'], 'string', 'max' => 32],
-            [['USER_NAME'], 'string', 'max' => 16],
-            [['REAL_NAME'], 'string', 'max' => 128],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_ID' => 'ID',
-            'USER_NAME' => '编号',
-            'REAL_NAME' => '名称',
-        ];
-    }
-}

+ 0 - 47
common/models/TmpFreezeUser.php

@@ -1,47 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%TMP_FREEZE_USER}}".
- *
- * @property string $ID
- * @property string $USER_NAME 编号
- * @property string $REAL_NAME 名称
- */
-class TmpFreezeUser extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%TMP_FREEZE_USER}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_NAME', 'REAL_NAME'], 'required'],
-            [['ID'], 'string', 'max' => 32],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_NAME' => '编号',
-            'REAL_NAME' => '名称',
-        ];
-    }
-}

+ 0 - 60
common/models/TmpOldNetwork.php

@@ -1,60 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%TMP_OLD_NETWORK}}".
- *
- * @property string $ID
- * @property string $USER_NAME 编号
- * @property string $REAL_NAME 姓名
- * @property string $PARENT_USER_NAME 上级编号
- * @property string $PARENT_REAL_NAME 上级姓名
- * @property string $NET_USER_NAME 安置人编号
- * @property string $NET_REAL_NAME 安置人姓名
- * @property int $SORT 排序
- */
-class TmpOldNetwork extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%TMP_OLD_NETWORK}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_NAME', 'REAL_NAME', 'PARENT_USER_NAME', 'PARENT_REAL_NAME', 'NET_USER_NAME', 'NET_REAL_NAME'], 'required'],
-            [['SORT'], 'integer'],
-            [['ID'], 'string', 'max' => 32],
-            [['USER_NAME', 'PARENT_USER_NAME', 'NET_USER_NAME'], 'string', 'max' => 16],
-            [['REAL_NAME', 'PARENT_REAL_NAME', 'NET_REAL_NAME'], 'string', 'max' => 128],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_NAME' => '编号',
-            'REAL_NAME' => '姓名',
-            'PARENT_USER_NAME' => '上级编号',
-            'PARENT_REAL_NAME' => '上级姓名',
-            'NET_USER_NAME' => '安置人编号',
-            'NET_REAL_NAME' => '安置人姓名',
-            'SORT' => '排序',
-        ];
-    }
-}

+ 0 - 64
common/models/TmpOldNetworkAll.php

@@ -1,64 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%TMP_OLD_NETWORK_ALL}}".
- *
- * @property string $ID
- * @property string $USER_NAME 编号
- * @property string $REAL_NAME 姓名
- * @property string $PARENT_USER_NAME 上级编号
- * @property string $PARENT_REAL_NAME 上级姓名
- * @property string $NET_USER_NAME 安置人编号
- * @property string $NET_REAL_NAME 安置人姓名
- * @property int $SORT 排序
- * @property int $NET_DEEP 安置深度
- * @property int $REC_DEEP 推荐深度
- */
-class TmpOldNetworkAll extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%TMP_OLD_NETWORK_ALL}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_NAME', 'REAL_NAME', 'PARENT_USER_NAME', 'PARENT_REAL_NAME', 'NET_USER_NAME', 'NET_REAL_NAME'], 'required'],
-            [['SORT','NET_DEEP','REC_DEEP'], 'integer'],
-            [['ID'], 'string', 'max' => 32],
-            [['USER_NAME', 'PARENT_USER_NAME', 'NET_USER_NAME'], 'string', 'max' => 16],
-            [['REAL_NAME', 'PARENT_REAL_NAME', 'NET_REAL_NAME'], 'string', 'max' => 128],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_NAME' => '编号',
-            'REAL_NAME' => '姓名',
-            'PARENT_USER_NAME' => '上级编号',
-            'PARENT_REAL_NAME' => '上级姓名',
-            'NET_USER_NAME' => '安置人编号',
-            'NET_REAL_NAME' => '安置人姓名',
-            'SORT' => '排序',
-            'NET_DEEP' => '安置深度',
-            'REC_DEEP' => '推荐深度',
-        ];
-    }
-}

+ 0 - 64
common/models/TmpOldNetworkError.php

@@ -1,64 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%TMP_OLD_NETWORK_ERROR}}".
- *
- * @property string $ID
- * @property string $USER_NAME 编号
- * @property string $REAL_NAME 姓名
- * @property string $PARENT_USER_NAME 上级编号
- * @property string $PARENT_REAL_NAME 上级姓名
- * @property string $NET_USER_NAME 安置人编号
- * @property string $NET_REAL_NAME 安置人姓名
- * @property int $SORT 排序
- * @property int $NET_DEEP 安置深度
- * @property int $REC_DEEP 推荐深度
- */
-class TmpOldNetworkError extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%TMP_OLD_NETWORK_ERROR}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_NAME', 'REAL_NAME', 'PARENT_USER_NAME', 'PARENT_REAL_NAME', 'NET_USER_NAME', 'NET_REAL_NAME'], 'required'],
-            [['SORT','NET_DEEP','REC_DEEP'], 'integer'],
-            [['ID'], 'string', 'max' => 32],
-            [['USER_NAME', 'PARENT_USER_NAME', 'NET_USER_NAME'], 'string', 'max' => 16],
-            [['REAL_NAME', 'PARENT_REAL_NAME', 'NET_REAL_NAME'], 'string', 'max' => 128],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_NAME' => '编号',
-            'REAL_NAME' => '姓名',
-            'PARENT_USER_NAME' => '上级编号',
-            'PARENT_REAL_NAME' => '上级姓名',
-            'NET_USER_NAME' => '安置人编号',
-            'NET_REAL_NAME' => '安置人姓名',
-            'SORT' => '排序',
-            'NET_DEEP' => '安置深度',
-            'REC_DEEP' => '推荐深度',
-        ];
-    }
-}

+ 0 - 64
common/models/TmpOldNetworkReplenish.php

@@ -1,64 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%TMP_OLD_NETWORK_REPLENISH}}".
- *
- * @property string $ID
- * @property string $USER_NAME 编号
- * @property string $REAL_NAME 姓名
- * @property string $PARENT_USER_NAME 上级编号
- * @property string $PARENT_REAL_NAME 上级姓名
- * @property string $NET_USER_NAME 安置人编号
- * @property string $NET_REAL_NAME 安置人姓名
- * @property int $SORT 排序
- * @property int $NET_DEEP 安置深度
- * @property int $REC_DEEP 推荐深度
- */
-class TmpOldNetworkReplenish extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%TMP_OLD_NETWORK_REPLENISH}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_NAME', 'REAL_NAME', 'PARENT_USER_NAME', 'PARENT_REAL_NAME', 'NET_USER_NAME', 'NET_REAL_NAME'], 'required'],
-            [['SORT','NET_DEEP','REC_DEEP'], 'integer'],
-            [['ID'], 'string', 'max' => 32],
-            [['USER_NAME', 'PARENT_USER_NAME', 'NET_USER_NAME'], 'string', 'max' => 16],
-            [['REAL_NAME', 'PARENT_REAL_NAME', 'NET_REAL_NAME'], 'string', 'max' => 128],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_NAME' => '编号',
-            'REAL_NAME' => '姓名',
-            'PARENT_USER_NAME' => '上级编号',
-            'PARENT_REAL_NAME' => '上级姓名',
-            'NET_USER_NAME' => '安置人编号',
-            'NET_REAL_NAME' => '安置人姓名',
-            'SORT' => '排序',
-            'NET_DEEP' => '安置深度',
-            'REC_DEEP' => '推荐深度',
-        ];
-    }
-}

+ 0 - 60
common/models/TmpOldUser.php

@@ -1,60 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%TMP_OLD_USER}}".
- *
- * @property string $ID
- * @property string $USER_NAME 编号
- * @property string $REAL_NAME 名称
- * @property string $REC_USER_NAME 推荐人编号
- * @property string $REC_REAL_NAME 推荐人姓名
- * @property string $NET_USER_NAME 安置人编号
- * @property string $NET_REAL_NAME 安置人姓名
- * @property int $SORT 排序
- */
-class TmpOldUser extends \common\components\ActiveRecord
-{
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%TMP_OLD_USER}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['USER_NAME', 'REAL_NAME', 'REC_USER_NAME', 'REC_REAL_NAME', 'NET_USER_NAME', 'NET_REAL_NAME'], 'required'],
-            [['SORT'], 'integer'],
-            [['ID'], 'string', 'max' => 32],
-            [['USER_NAME', 'REC_USER_NAME', 'NET_USER_NAME'], 'string', 'max' => 16],
-            [['REAL_NAME', 'REC_REAL_NAME', 'NET_REAL_NAME'], 'string', 'max' => 128],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'USER_NAME' => '编号',
-            'REAL_NAME' => '名称',
-            'REC_USER_NAME' => '推荐人编号',
-            'REC_REAL_NAME' => '推荐人姓名',
-            'NET_USER_NAME' => '安置人编号',
-            'NET_REAL_NAME' => '安置人姓名',
-            'SORT' => '排序',
-        ];
-    }
-}

+ 0 - 144
common/models/Transfer.php

@@ -1,144 +0,0 @@
-<?php
-
-namespace common\models;
-
-use common\helpers\Tool;
-use Yii;
-
-/**
- * This is the model class for table "{{%TRANSFER}}".
- *
- * @property string $ID
- * @property string $TRANSFER_SN 转账记录流水号
- * @property string $OUT_UID 转出会员ID
- * @property string $LAST_OUT_USER_NAME 转账时转出会员编号
- * @property string $LAST_OUT_REAL_NAME 转账时转出会员姓名
- * @property string $LAST_OUT_DEC_LV 转账时转出会员级别
- * @property string $LAST_OUT_DEC_ROLE_ID 转账时转出会员报单中心级别
- * @property string $OUT_WALLET 转出账户
- * @property string $LAST_OUT_SYSTEM_ID 转账时转出会员体系
- * @property string $IN_UID 转入会员ID
- * @property string $LAST_IN_USER_NAME 转账时转入会员编号
- * @property string $LAST_IN_REAL_NAME 转账时转入会员姓名
- * @property string $LAST_IN_DEC_LV 转账时转入会员级别
- * @property string $IN_WALLET 转入账户
- * @property string $LAST_IN_SYSTEM_ID 转账时转入会员体系
- * @property string $ORI_AMOUNT 转账金额
- * @property string $FEE 手续费
- * @property string $AMOUNT 实际转入金额
- * @property string $REMARK 备注
- * @property int $PERIOD_NUM 所在期数
- * @property int $CALC_MONTH 所在结算月
- * @property int $CREATED_AT 创建时间
- */
-class Transfer extends \common\components\ActiveRecord
-{
-
-    const WALLET_NAME = [
-        'bonus'=>'Bonus',
-        'cash'=>'Ecoin',
-    ];
-
-    /**
-     * {@inheritdoc}
-     */
-    public static function tableName()
-    {
-        return '{{%TRANSFER}}';
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function rules()
-    {
-        return [
-            [['TRANSFER_SN', 'OUT_UID', 'LAST_OUT_USER_NAME', 'LAST_OUT_REAL_NAME', 'IN_UID', 'LAST_IN_USER_NAME', 'LAST_IN_REAL_NAME', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT'], 'required'],
-            [['ORI_AMOUNT', 'FEE', 'AMOUNT'], 'number'],
-            [['PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT'], 'integer'],
-            [['ID', 'TRANSFER_SN', 'OUT_UID', 'LAST_OUT_DEC_LV', 'LAST_OUT_DEC_ROLE_ID', 'LAST_OUT_SYSTEM_ID', 'IN_UID', 'LAST_IN_DEC_LV', 'LAST_IN_SYSTEM_ID'], 'string', 'max' => 32],
-            [['LAST_OUT_USER_NAME', 'LAST_IN_USER_NAME'], 'string', 'max' => 16],
-            [['LAST_OUT_REAL_NAME', 'OUT_WALLET', 'LAST_IN_REAL_NAME', 'IN_WALLET'], 'string', 'max' => 128],
-            [['REMARK'], 'string', 'max' => 4000],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'TRANSFER_SN' => '转账记录流水号',
-            'OUT_UID' => '转出会员ID',
-            'LAST_OUT_USER_NAME' => '转账时转出会员编号',
-            'LAST_OUT_REAL_NAME' => '转账时转出会员姓名',
-            'LAST_OUT_DEC_LV' => '转账时转出会员级别',
-            'LAST_OUT_DEC_ROLE_ID' => '转账时转出会员报单中心级别',
-            'OUT_WALLET' => '转出账户',
-            'LAST_OUT_SYSTEM_ID' => '转账时转出会员体系',
-            'IN_UID' => '转入会员ID',
-            'LAST_IN_USER_NAME' => '转账时转入会员编号',
-            'LAST_IN_REAL_NAME' => '转账时转入会员姓名',
-            'LAST_IN_DEC_LV' => '转账时转入会员级别',
-            'IN_WALLET' => '转入账户',
-            'LAST_IN_SYSTEM_ID' => '转账时转入会员体系',
-            'ORI_AMOUNT' => '转账金额',
-            'FEE' => '手续费',
-            'AMOUNT' => '实际转入金额',
-            'REMARK' => '备注',
-            'PERIOD_NUM' => '所在期数',
-            'CALC_MONTH' => '所在结算月',
-            'CREATED_AT' => '创建时间',
-        ];
-    }
-
-    /**
-     * 生成sn
-     * @return string
-     */
-    public static function generateSN() {
-        $date = date('ymdHis');
-        $sn = 'BZZ' . $date . Tool::numFix(rand(1, 9999999999), 10, '0');
-        if (self::find()->where('TRANSFER_SN=:SN', [':SN' => $sn])->exists()) {
-            return self::generateSN();
-        }
-        return $sn;
-    }
-
-    /**
-     * 本周是否转账
-     * @param $uid
-     * @return bool
-     */
-    public static function hasThisWeekTransfer($uid) {
-        $period = Period::instance();
-        if (static::find()->where('OUT_UID=:OUT_UID AND PERIOD_NUM=:PERIOD_NUM', [':OUT_UID' => $uid, ':PERIOD_NUM' => $period->getNowPeriodNum()])->exists()) {
-            return true;
-        }
-        return false;
-    }
-
-    /**
-     * 本周提现总额
-     * @param $uid
-     * @return mixed
-     */
-    public static function weekTransfer($uid){
-        $period = Period::instance();
-        return static::find()->where('OUT_UID=:OUT_UID AND PERIOD_NUM=:PERIOD_NUM', [':OUT_UID' => $uid, ':PERIOD_NUM' => $period->getNowPeriodNum()])->sum('ORI_AMOUNT');
-    }
-
-    /**
-     * 本月提现总额
-     * @param $uid
-     * @return mixed
-     */
-    public static function monthTransfer($uid){
-        $period = Period::instance();
-        return static::find()->where('OUT_UID=:OUT_UID AND CALC_MONTH=:CALC_MONTH', [':OUT_UID' => $uid, ':CALC_MONTH' => $period->getNowYearMonth()])->sum('ORI_AMOUNT');
-    }
-
-}

+ 0 - 64
common/models/UpgradeType.php

@@ -1,64 +0,0 @@
-<?php
-
-namespace common\models;
-
-use Yii;
-
-/**
- * This is the model class for table "{{%UPGRADE_TYPE}}".
- *
- * @property string $ID
- * @property string $USER_ID 会员ID
- * @property int $TYPE 报单类型
- * @property string $INSERT_USER_ID 首购会员ID
- * @property string $DEC_AMOUNT 报单金额
- * @property string $DEC_PV 报单PV
- * @property int $PERIOD_NUM 报单期数
- * @property int $STATUS 状态
- * @property int $CREATED_AT 创建时间
- */
-class UpgradeType extends \common\components\ActiveRecord
-{
-    /**
-     * @inheritdoc
-     */
-    public static function tableName()
-    {
-        return '{{%UPGRADE_TYPE}}';
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function rules()
-    {
-        return [
-            [['OBSERVE_NAME', 'SORTS', 'IS_STATUS', 'NATION_ID','OBSERVE_TYPE','CREATE_AT'], 'required'],
-            [['OBSERVE_TYPE', 'NATION_ID', 'IS_STATUS', 'CREATED_AT'], 'integer'],
-            [['ID'], 'unique'],
-        ];
-    }
-
-    /**
-     * @inheritdoc
-     */
-    public function attributeLabels()
-    {
-        return [
-            'ID' => 'ID',
-            'OBSERVE_NAME' => '升级方式名称',
-            'SORTS' => '排序',
-            'IS_STATUS' => '状态0为默认启用  1为禁用 ',
-            'NATION_ID' => '国家id',
-            'OBSERVE_TYPE' => '升级类型 1为补差额升级类型  2为全额升级类型',
-            'CREATE_AT' => '创建时间'
-        ];
-    }
-
-    // 根据类型获取升级方式
-    public static function getOneByType($type) {
-        $result = UpgradeType::findOneAsArray('OBSERVE_TYPE=:OBSERVE_TYPE  AND IS_STATUS=0', [':OBSERVE_TYPE'=>$type]);
-        
-        return $result;
-    }
-}

Неке датотеке нису приказане због велике количине промена