@@ -1,7 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | use yii\helpers\Url; |
3 | 3 | use yuncms\helpers\Html; |
4 | - ?> |
|
4 | + ?> |
|
5 | 5 | <li class="nav-header"> |
6 | 6 | <div class="logo-element-main"> |
7 | 7 | YUNCMS |
@@ -52,7 +52,7 @@ |
||
52 | 52 | public function save() |
53 | 53 | { |
54 | 54 | if ($this->validate()) { |
55 | - if(AvatarHelper::save($this->getUser(), $this->_originalImage)){ |
|
55 | + if (AvatarHelper::save($this->getUser(), $this->_originalImage)) { |
|
56 | 56 | return true; |
57 | 57 | } else { |
58 | 58 | return false; |
@@ -161,8 +161,9 @@ |
||
161 | 161 | return ['url' => $attachment, 'path' => $attachment,]; |
162 | 162 | } else if (is_array($attachment)) { |
163 | 163 | return $attachment; |
164 | - } else if ($attachment instanceof Arrayable) |
|
165 | - return $attachment->toArray(); |
|
164 | + } else if ($attachment instanceof Arrayable) { |
|
165 | + return $attachment->toArray(); |
|
166 | + } |
|
166 | 167 | return []; |
167 | 168 | } |
168 | 169 |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | if (empty($this->url)) { |
96 | 96 | if ($this->onlyImage === false) { |
97 | 97 | $this->url = $this->multiple ? ['/upload/files-upload'] : ['/upload/file-upload']; |
98 | - $fileAllowFiles = Yii::$app->getSettings()->get('fileAllowFiles','attachment'); |
|
98 | + $fileAllowFiles = Yii::$app->getSettings()->get('fileAllowFiles', 'attachment'); |
|
99 | 99 | $regExp = '/(\.|\/)('; |
100 | 100 | $extensions = explode(',', $fileAllowFiles); |
101 | 101 | foreach ($extensions as $extension) { |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | } |
131 | 131 | $this->fileInputName = md5($this->name); |
132 | 132 | if (!array_key_exists('file_param', $this->url)) { |
133 | - $this->url['file_param'] = $this->fileInputName;//服务器需要通过这个判断是哪一个input name上传的 |
|
133 | + $this->url['file_param'] = $this->fileInputName; //服务器需要通过这个判断是哪一个input name上传的 |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | $this->clientOptions = ArrayHelper::merge($this->clientOptions, [ |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | protected function formatAttachment($attachment) |
161 | 161 | { |
162 | 162 | if (!empty($attachment) && is_string($attachment)) { |
163 | - return ['url' => $attachment, 'path' => $attachment,]; |
|
163 | + return ['url' => $attachment, 'path' => $attachment, ]; |
|
164 | 164 | } else if (is_array($attachment)) { |
165 | 165 | return $attachment; |
166 | 166 | } else if ($attachment instanceof Arrayable) |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public static function getImageMaxSizeByte() |
48 | 48 | { |
49 | - $imageMaxSize = Yii::$app->getSettings()->get('imageMaxSize','attachment'); |
|
49 | + $imageMaxSize = Yii::$app->getSettings()->get('imageMaxSize', 'attachment'); |
|
50 | 50 | return self::getMaxUploadByte($imageMaxSize); |
51 | 51 | } |
52 | 52 | |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | */ |
57 | 57 | public static function getVideoMaxSizeByte() |
58 | 58 | { |
59 | - $videoMaxSize = Yii::$app->getSettings()->get('videoMaxSize','attachment'); |
|
59 | + $videoMaxSize = Yii::$app->getSettings()->get('videoMaxSize', 'attachment'); |
|
60 | 60 | return self::getMaxUploadByte($videoMaxSize); |
61 | 61 | } |
62 | 62 | |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public static function getFileMaxSizeByte() |
68 | 68 | { |
69 | - $fileMaxSize = Yii::$app->getSettings()->get('fileMaxSize','attachment'); |
|
69 | + $fileMaxSize = Yii::$app->getSettings()->get('fileMaxSize', 'attachment'); |
|
70 | 70 | return self::getMaxUploadByte($fileMaxSize); |
71 | 71 | } |
72 | 72 | |
@@ -76,9 +76,9 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public static function getAcceptImageMimeTypes() |
78 | 78 | { |
79 | - $imageAllowFiles = Yii::$app->getSettings()->get('imageAllowFiles','attachment'); |
|
79 | + $imageAllowFiles = Yii::$app->getSettings()->get('imageAllowFiles', 'attachment'); |
|
80 | 80 | $extensions = explode(',', $imageAllowFiles); |
81 | - array_walk($extensions, function (&$value) { |
|
81 | + array_walk($extensions, function(&$value) { |
|
82 | 82 | $value = 'image/' . $value; |
83 | 83 | }); |
84 | 84 | return $extensions; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | public static function normalizeExtension($extensions) |
94 | 94 | { |
95 | 95 | $extensions = explode(',', $extensions); |
96 | - array_walk($extensions, function (&$value) { |
|
96 | + array_walk($extensions, function(&$value) { |
|
97 | 97 | $value = '.' . $value; |
98 | 98 | }); |
99 | 99 | return $extensions; |
@@ -43,7 +43,7 @@ |
||
43 | 43 | 'failure_code' => $this->string(),//订单的错误码 |
44 | 44 | 'failure_msg' => $this->string(),//订单的错误消息的描述。 |
45 | 45 | 'metadata' => $this->text(), |
46 | - // 'credential',//支付凭证,用于客户端发起支付。 |
|
46 | + // 'credential',//支付凭证,用于客户端发起支付。 |
|
47 | 47 | 'description' => $this->string(255),//订单附加说明,最多 255 个 Unicode 字符。 |
48 | 48 | 'created_at' => $this->unixTimestamp(), |
49 | 49 | ], $tableOptions); |
@@ -22,29 +22,29 @@ |
||
22 | 22 | |
23 | 23 | $this->createTable($this->tableName, [ |
24 | 24 | 'id' => $this->primaryKey()->unsigned(), |
25 | - 'paid' => $this->boolean()->defaultValue(false),//boolean 是否已付款 |
|
26 | - 'refunded' => $this->boolean()->defaultValue(false),//boolean 是否存在退款信息 |
|
27 | - 'reversed' => $this->boolean()->defaultValue(false),//boolean 订单是否撤销 |
|
28 | - 'channel' => $this->string(50)->notNull(),//付款渠道 |
|
29 | - 'order_no' => $this->string()->notNull(),//商户订单号,适配每个渠道对此参数的要求,必须在商户的系统内唯一 |
|
30 | - 'client_ip' => $this->ipAddress()->notNull(),//发起支付请求客户端的 IP 地址 |
|
31 | - 'amount' => $this->unsignedInteger()->notNull(),//订单总金额(必须大于 0),单位为对应币种的最小货币单位,人民币为分 |
|
32 | - 'amount_settle' => $this->unsignedInteger()->notNull(),//清算金额,单位为对应币种的最小货币单位,人民币为分。 |
|
33 | - 'currency' => $this->string(3)->notNull(),//3 位 ISO 货币代码,人民币为 cny 。 |
|
34 | - 'subject' => $this->string(32)->notNull(),//商品标题,该参数最长为 32 个 Unicode 字符 |
|
35 | - 'body' => $this->string(128)->notNull(),//商品描述信息,该参数最长为 128 个 Unicode 字符 |
|
25 | + 'paid' => $this->boolean()->defaultValue(false), //boolean 是否已付款 |
|
26 | + 'refunded' => $this->boolean()->defaultValue(false), //boolean 是否存在退款信息 |
|
27 | + 'reversed' => $this->boolean()->defaultValue(false), //boolean 订单是否撤销 |
|
28 | + 'channel' => $this->string(50)->notNull(), //付款渠道 |
|
29 | + 'order_no' => $this->string()->notNull(), //商户订单号,适配每个渠道对此参数的要求,必须在商户的系统内唯一 |
|
30 | + 'client_ip' => $this->ipAddress()->notNull(), //发起支付请求客户端的 IP 地址 |
|
31 | + 'amount' => $this->unsignedInteger()->notNull(), //订单总金额(必须大于 0),单位为对应币种的最小货币单位,人民币为分 |
|
32 | + 'amount_settle' => $this->unsignedInteger()->notNull(), //清算金额,单位为对应币种的最小货币单位,人民币为分。 |
|
33 | + 'currency' => $this->string(3)->notNull(), //3 位 ISO 货币代码,人民币为 cny 。 |
|
34 | + 'subject' => $this->string(32)->notNull(), //商品标题,该参数最长为 32 个 Unicode 字符 |
|
35 | + 'body' => $this->string(128)->notNull(), //商品描述信息,该参数最长为 128 个 Unicode 字符 |
|
36 | 36 | //'extra',//特定渠道发起交易时需要的额外参数,以及部分渠道支付成功返回的额外参数 |
37 | - 'time_paid' => $this->unixTimestamp(),//订单支付完成时的 Unix 时间戳。(银联支付成功时间为接收异步通知的时间) |
|
38 | - 'time_expire' => $this->unixTimestamp(),//订单失效时间 |
|
39 | - 'time_settle' => $this->unixTimestamp(),//订单清算时间,用 Unix 时间戳表示。(暂不生效) |
|
40 | - 'transaction_no' => $this->string(64),//支付渠道返回的交易流水号。 |
|
37 | + 'time_paid' => $this->unixTimestamp(), //订单支付完成时的 Unix 时间戳。(银联支付成功时间为接收异步通知的时间) |
|
38 | + 'time_expire' => $this->unixTimestamp(), //订单失效时间 |
|
39 | + 'time_settle' => $this->unixTimestamp(), //订单清算时间,用 Unix 时间戳表示。(暂不生效) |
|
40 | + 'transaction_no' => $this->string(64), //支付渠道返回的交易流水号。 |
|
41 | 41 | //'refunds',//退款详情列表 |
42 | - 'amount_refunded' => $this->unsignedInteger()->notNull(),//已退款总金额,单位为对应币种的最小货币单位,例如:人民币为分。 |
|
43 | - 'failure_code' => $this->string(),//订单的错误码 |
|
44 | - 'failure_msg' => $this->string(),//订单的错误消息的描述。 |
|
42 | + 'amount_refunded' => $this->unsignedInteger()->notNull(), //已退款总金额,单位为对应币种的最小货币单位,例如:人民币为分。 |
|
43 | + 'failure_code' => $this->string(), //订单的错误码 |
|
44 | + 'failure_msg' => $this->string(), //订单的错误消息的描述。 |
|
45 | 45 | 'metadata' => $this->text(), |
46 | 46 | // 'credential',//支付凭证,用于客户端发起支付。 |
47 | - 'description' => $this->string(255),//订单附加说明,最多 255 个 Unicode 字符。 |
|
47 | + 'description' => $this->string(255), //订单附加说明,最多 255 个 Unicode 字符。 |
|
48 | 48 | 'created_at' => $this->unixTimestamp(), |
49 | 49 | ], $tableOptions); |
50 | 50 | } |
@@ -21,18 +21,18 @@ |
||
21 | 21 | } |
22 | 22 | $this->createTable($this->tableName, [ |
23 | 23 | 'id' => $this->bigPrimaryKey(), |
24 | - 'amount' => $this->unsignedInteger()->notNull(),//退款金额大于 0, 单位为对应币种的最小货币单位,例如:人民币为分(如退款金额为 1 元,此处请填 100)。必须小于等于可退款金额,默认为全额退款。 |
|
25 | - 'succeed' => $this->boolean()->defaultValue(false),//退款是否成功。 |
|
26 | - 'status' => $this->string(10)->defaultValue('pending'),//退款状态(目前支持三种状态: pending: 处理中; succeeded: 成功; failed: 失败)。 |
|
27 | - 'time_succeed' => $this->unixTimestamp(),//退款成功的时间,用 Unix 时间戳表示。 |
|
28 | - 'description' => $this->string(255)->notNull(),//退款详情,最多 255 个 Unicode 字符。 |
|
29 | - 'failure_code' => $this->string(),//退款的错误码,详见 错误 中的错误码。 |
|
30 | - 'failure_msg' => $this->string(),//退款消息的描述。 |
|
24 | + 'amount' => $this->unsignedInteger()->notNull(), //退款金额大于 0, 单位为对应币种的最小货币单位,例如:人民币为分(如退款金额为 1 元,此处请填 100)。必须小于等于可退款金额,默认为全额退款。 |
|
25 | + 'succeed' => $this->boolean()->defaultValue(false), //退款是否成功。 |
|
26 | + 'status' => $this->string(10)->defaultValue('pending'), //退款状态(目前支持三种状态: pending: 处理中; succeeded: 成功; failed: 失败)。 |
|
27 | + 'time_succeed' => $this->unixTimestamp(), //退款成功的时间,用 Unix 时间戳表示。 |
|
28 | + 'description' => $this->string(255)->notNull(), //退款详情,最多 255 个 Unicode 字符。 |
|
29 | + 'failure_code' => $this->string(), //退款的错误码,详见 错误 中的错误码。 |
|
30 | + 'failure_msg' => $this->string(), //退款消息的描述。 |
|
31 | 31 | //'metadata', |
32 | - 'charge_id' => $this->unsignedInteger()->notNull(),//支付 charge 对象的 id |
|
33 | - 'charge_order_no' => $this->string(64),//商户订单号,这边返回的是 charge 对象中的 order_no 参数。 |
|
34 | - 'transaction_no' => $this->string(64),//支付渠道返回的交易流水号,部分渠道返回该字段为空。 |
|
35 | - 'funding_source' => $this->string(20),//微信及 QQ 类退款资金来源。取值范围: unsettled_funds :使用未结算资金退款; recharge_funds :微信-使用可用余额退款,QQ-使用可用现金账户资金退款。注:默认值 unsettled_funds ,该参数对于微信渠道的退款来说仅适用于微信老资金流商户使用,包括 wx 、 wx_pub 、 wx_pub_qr 、 wx_lite 、 wx_wap 、 wx_pub_scan 六个渠道;新资金流退款资金默认从基本账户中扣除。该参数仅在请求退款,传入该字段时返回。 |
|
32 | + 'charge_id' => $this->unsignedInteger()->notNull(), //支付 charge 对象的 id |
|
33 | + 'charge_order_no' => $this->string(64), //商户订单号,这边返回的是 charge 对象中的 order_no 参数。 |
|
34 | + 'transaction_no' => $this->string(64), //支付渠道返回的交易流水号,部分渠道返回该字段为空。 |
|
35 | + 'funding_source' => $this->string(20), //微信及 QQ 类退款资金来源。取值范围: unsettled_funds :使用未结算资金退款; recharge_funds :微信-使用可用余额退款,QQ-使用可用现金账户资金退款。注:默认值 unsettled_funds ,该参数对于微信渠道的退款来说仅适用于微信老资金流商户使用,包括 wx 、 wx_pub 、 wx_pub_qr 、 wx_lite 、 wx_wap 、 wx_pub_scan 六个渠道;新资金流退款资金默认从基本账户中扣除。该参数仅在请求退款,传入该字段时返回。 |
|
36 | 36 | //'extra', |
37 | 37 | 'created_at' => $this->unixTimestamp(), |
38 | 38 | ], $tableOptions); |
@@ -26,23 +26,23 @@ |
||
26 | 26 | const DEFAULT_TIMEOUT = 5.0; |
27 | 27 | |
28 | 28 | //交易类型 |
29 | - const TRADE_TYPE_QR_CODE = 'qr-code';//扫码支付 |
|
30 | - const TRADE_TYPE_JS_API = 'js-api';//应用内JS API,如微信 |
|
31 | - const TRADE_TYPE_APP = 'app';//app支付 |
|
32 | - const TRADE_TYPE_WAP = 'wap';//H5支付 |
|
33 | - const TRADE_TYPE_WEB = 'web';//PC支付 |
|
34 | - const TRADE_TYPE_POS = 'pos';//刷卡支付 |
|
29 | + const TRADE_TYPE_QR_CODE = 'qr-code'; //扫码支付 |
|
30 | + const TRADE_TYPE_JS_API = 'js-api'; //应用内JS API,如微信 |
|
31 | + const TRADE_TYPE_APP = 'app'; //app支付 |
|
32 | + const TRADE_TYPE_WAP = 'wap'; //H5支付 |
|
33 | + const TRADE_TYPE_WEB = 'web'; //PC支付 |
|
34 | + const TRADE_TYPE_POS = 'pos'; //刷卡支付 |
|
35 | 35 | |
36 | 36 | //交易状态 |
37 | - const STATE_NOT_PAY = 0b0;//未支付 |
|
38 | - const STATE_SUCCESS = 0b1;//支付成功 |
|
39 | - const STATE_FAILED = 0b10;//支付失败 |
|
40 | - const STATE_CLOSED = 0b100;//已关闭 |
|
41 | - const STATE_REVOKED = 0b101;//已撤销 |
|
42 | - const STATE_ERROR = 0b110;//错误 |
|
43 | - const STATE_REFUND = 0b111;//转入退款 |
|
44 | - const STATE_REFUND_SUCCESS = 0b11;//转入退款 |
|
45 | - const STATE_REFUND_FAILED = 0b11;//转入退款 |
|
37 | + const STATE_NOT_PAY = 0b0; //未支付 |
|
38 | + const STATE_SUCCESS = 0b1; //支付成功 |
|
39 | + const STATE_FAILED = 0b10; //支付失败 |
|
40 | + const STATE_CLOSED = 0b100; //已关闭 |
|
41 | + const STATE_REVOKED = 0b101; //已撤销 |
|
42 | + const STATE_ERROR = 0b110; //错误 |
|
43 | + const STATE_REFUND = 0b111; //转入退款 |
|
44 | + const STATE_REFUND_SUCCESS = 0b11; //转入退款 |
|
45 | + const STATE_REFUND_FAILED = 0b11; //转入退款 |
|
46 | 46 | |
47 | 47 | /** |
48 | 48 | * @var float 连接超时时间 |