| 123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- /**
- * 通用业务
- * shish 2019.8.20
- */
- namespace common\components;
- use Yii;
- class business
- {
-
- //支付方式对应资金要保存的字段 shish 2019.8.20
- public static function savePayWayAmount($object, $amount, $payWay)
- {
- switch ($payWay) {
- case 0:
- $object->weixin += $amount;
- break;
- case 1:
- $object->alipay += $amount;
- break;
- case 2:
- $object->balancePay += $amount;
- break;
- case 3:
- $object->cash += $amount;
- break;
- default:
- util::fail('付款方式不存在');
- }
- return $object;
- }
-
- }
|