@@ -61,7 +61,7 @@ |
||
61 | 61 | */ |
62 | 62 | public static function filterEmptyStringsFromArray(array $arr): array |
63 | 63 | { |
64 | - return array_filter($arr, function ($value): bool { |
|
64 | + return array_filter($arr, function($value): bool { |
|
65 | 65 | return $value !== ''; |
66 | 66 | }); |
67 | 67 | } |
@@ -405,6 +405,6 @@ |
||
405 | 405 | } elseif ($items instanceof Traversable) { |
406 | 406 | return iterator_to_array($items); |
407 | 407 | } |
408 | - return (array) $items; |
|
408 | + return (array)$items; |
|
409 | 409 | } |
410 | 410 | } |
411 | 411 | \ No newline at end of file |
@@ -400,7 +400,7 @@ |
||
400 | 400 | return $items->all(); |
401 | 401 | } elseif ($items instanceof Arrayable) { |
402 | 402 | return $items->toArray(); |
403 | - } elseif ($items instanceof JsonSerializable) { |
|
403 | + } elseif ($items instanceof JsonSerializable) { |
|
404 | 404 | return $items->jsonSerialize(); |
405 | 405 | } elseif ($items instanceof Traversable) { |
406 | 406 | return iterator_to_array($items); |
@@ -43,7 +43,7 @@ |
||
43 | 43 | { |
44 | 44 | parent::init(); |
45 | 45 | if (empty($this->attributes)) { |
46 | - $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => [$this->attribute],]; |
|
46 | + $this->attributes = [BaseActiveRecord::EVENT_BEFORE_INSERT => [$this->attribute], ]; |
|
47 | 47 | } |
48 | 48 | if ($this->attribute === null) { |
49 | 49 | throw new InvalidConfigException('Either "attribute" property must be specified.'); |
@@ -72,13 +72,13 @@ discard block |
||
72 | 72 | const AFTER_REGISTER = 'afterRegister'; |
73 | 73 | |
74 | 74 | //场景定义 |
75 | - const SCENARIO_CREATE = 'create';//后台或控制台创建用户 |
|
76 | - const SCENARIO_UPDATE = 'update';//后台或控制台修改用户 |
|
77 | - const SCENARIO_REGISTER = 'basic_create';//邮箱注册 |
|
78 | - const SCENARIO_EMAIL_REGISTER = 'email_create';//邮箱注册 |
|
79 | - const SCENARIO_MOBILE_REGISTER = 'mobile_create';//手机号注册 |
|
80 | - const SCENARIO_SETTINGS = 'settings';//更新 |
|
81 | - const SCENARIO_CONNECT = 'connect';//账户链接或自动注册新用户 |
|
75 | + const SCENARIO_CREATE = 'create'; //后台或控制台创建用户 |
|
76 | + const SCENARIO_UPDATE = 'update'; //后台或控制台修改用户 |
|
77 | + const SCENARIO_REGISTER = 'basic_create'; //邮箱注册 |
|
78 | + const SCENARIO_EMAIL_REGISTER = 'email_create'; //邮箱注册 |
|
79 | + const SCENARIO_MOBILE_REGISTER = 'mobile_create'; //手机号注册 |
|
80 | + const SCENARIO_SETTINGS = 'settings'; //更新 |
|
81 | + const SCENARIO_CONNECT = 'connect'; //账户链接或自动注册新用户 |
|
82 | 82 | const SCENARIO_PASSWORD = 'password'; |
83 | 83 | |
84 | 84 | // following constants are used on secured email changing process |
@@ -157,8 +157,8 @@ discard block |
||
157 | 157 | static::SCENARIO_EMAIL_REGISTER => ['nickname', 'email', 'password'], |
158 | 158 | static::SCENARIO_MOBILE_REGISTER => ['mobile', 'password'], |
159 | 159 | static::SCENARIO_SETTINGS => ['username', 'email', 'password'], |
160 | - static::SCENARIO_CONNECT => ['nickname', 'email', 'password'],//链接账户密码可以为空邮箱可以为空 |
|
161 | - static::SCENARIO_PASSWORD => ['password'],//只修改密码 |
|
160 | + static::SCENARIO_CONNECT => ['nickname', 'email', 'password'], //链接账户密码可以为空邮箱可以为空 |
|
161 | + static::SCENARIO_PASSWORD => ['password'], //只修改密码 |
|
162 | 162 | ]); |
163 | 163 | } |
164 | 164 |
@@ -34,10 +34,10 @@ |
||
34 | 34 | { |
35 | 35 | parent::init(); |
36 | 36 | if (empty ($this->appKey)) { |
37 | - throw new InvalidConfigException ('The "appKey" property must be set.'); |
|
37 | + throw new InvalidConfigException('The "appKey" property must be set.'); |
|
38 | 38 | } |
39 | 39 | if (empty ($this->appSecret)) { |
40 | - throw new InvalidConfigException ('The "appSecret" property must be set.'); |
|
40 | + throw new InvalidConfigException('The "appSecret" property must be set.'); |
|
41 | 41 | } |
42 | 42 | $this->_client = new JPush($this->appKey, $this->appSecret); |
43 | 43 | } |
@@ -56,7 +56,7 @@ |
||
56 | 56 | */ |
57 | 57 | public function exportFor($channel) |
58 | 58 | { |
59 | - if (method_exists($this, $method = 'exportFor'.Inflector::camelize($channel))) { |
|
59 | + if (method_exists($this, $method = 'exportFor' . Inflector::camelize($channel))) { |
|
60 | 60 | return $this->{$method}(); |
61 | 61 | } |
62 | 62 | throw new \InvalidArgumentException("Can not find message export for chanel `{$channel}`"); |
@@ -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->unsignedBigInteger()->notNull(),//支付 charge 对象的 id |
|
33 | - 'charge_order_no',//商户订单号,这边返回的是 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->unsignedBigInteger()->notNull(), //支付 charge 对象的 id |
|
33 | + 'charge_order_no', //商户订单号,这边返回的是 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); |
@@ -22,29 +22,29 @@ |
||
22 | 22 | |
23 | 23 | $this->createTable($this->tableName, [ |
24 | 24 | 'id' => $this->bigPrimaryKey(), |
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', |
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 | } |
@@ -23,8 +23,8 @@ |
||
23 | 23 | /** |
24 | 24 | * Handles adding <?= $columns ?> to table `<?= $table ?>`. |
25 | 25 | <?= $this->render('_foreignTables', [ |
26 | - 'foreignKeys' => $foreignKeys, |
|
27 | - ]) ?> |
|
26 | + 'foreignKeys' => $foreignKeys, |
|
27 | + ]) ?> |
|
28 | 28 | */ |
29 | 29 | class <?= $className ?> extends Migration |
30 | 30 | { |