Bläddra i källkod

充值与提现

shish 5 år sedan
förälder
incheckning
3635ba27bd

+ 3 - 0
app-ghs/controllers/ShopController.php

@@ -6,6 +6,7 @@ use biz\sj\services\MerchantExtendService;
 use bizGhs\admin\classes\AdminClass;
 use bizGhs\merchant\classes\ShopClass;
 use bizGhs\merchant\services\ShopService;
+use common\components\dict;
 use common\components\dirUtil;
 use common\components\httpUtil;
 use common\components\imgUtil;
@@ -65,6 +66,8 @@ class ShopController extends BaseController
         }
         $sj = $this->sj;
         $sjName = $sj['name'] ?? '';
+        $ptStyle = $sj['style'] ?? dict::getDict('ptStyle', 'hd');
+        $data['ptStyle'] = $ptStyle;
         $data['merchantName'] = $sjName;
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();

+ 3 - 0
app-hd/controllers/ShopController.php

@@ -6,6 +6,7 @@ use biz\shop\classes\ShopClass;
 use biz\sj\services\MerchantExtendService;
 use bizGhs\admin\classes\AdminClass;
 use bizHd\merchant\services\ShopService;
+use common\components\dict;
 use common\components\dirUtil;
 use common\components\util;
 use common\components\wxUtil;
@@ -59,6 +60,8 @@ class ShopController extends BaseController
         $sj = $this->sj;
         $sjName = $sj['name'] ?? '';
         $data['merchantName'] = $sjName;
+        $ptStyle = $sj['style'] ?? dict::getDict('ptStyle', 'hd');
+        $data['ptStyle'] = $ptStyle;
         $connection = Yii::$app->db;
         $transaction = $connection->beginTransaction();
         try {

+ 6 - 1
biz-ghs/order/services/OrderService.php

@@ -406,7 +406,8 @@ class OrderService extends BaseService
     }
 
     //支付成功后的流程 shish 2021.5.14
-    public static function payAfter($order, $payWay)
+    //$isPurchase 是否零售端采购支付,如果是会引起销售方余额变动
+    public static function payAfter($order, $payWay, $isPurchase = false)
     {
         if (isset($order->status) == false) {
             util::fail('没有订单状态');
@@ -430,6 +431,10 @@ class OrderService extends BaseService
         $shop->totalIncome = bcadd($shop->totalIncome, $amount, 2);
         $shop->save();
 
+        if($isPurchase == true){
+
+        }
+
         //更新订单基础状态和支付状态
         $orderId = $order->id;
         $orderSn = $order->orderSn;

+ 43 - 7
biz-hd/merchant/classes/ShopClass.php

@@ -2,8 +2,12 @@
 
 namespace bizHd\merchant\classes;
 
+use biz\pt\classes\PtAssetClass;
+use biz\pt\models\PtAsset;
+use biz\shop\classes\ShopYeChangeClass;
 use bizGhs\product\classes\ProductClass;
 use bizHd\admin\classes\ShopAdminClass;
+use common\components\dict;
 use common\components\dirUtil;
 use common\components\httpUtil;
 use common\components\qrCodeUtil;
@@ -45,9 +49,9 @@ class ShopClass extends BaseClass
         $shop = self::add($data);
         $newShopId = $shop['id'];
         //初始化花材 linqh 2021.5.11
-        $adminId = $data['adminId']??0;
-        $shopId = $data['shopId']??0;
-        ProductClass::newShopInitProduct($data['merchantId'],$shopId,$newShopId,$adminId);
+        $adminId = $data['adminId'] ?? 0;
+        $shopId = $data['shopId'] ?? 0;
+        ProductClass::newShopInitProduct($data['merchantId'], $shopId, $newShopId, $adminId);
         return $shop;
     }
 
@@ -100,16 +104,48 @@ class ShopClass extends BaseClass
         return $gatheringCode;
     }
 
-    //增加余额 ssh 2021.2.21
+    //门店增加余额 ssh 2021.2.21
     //$fix = false 余额使用时不需要指定在谁那边用
-    public static function addBalance($shop, $amount, $fix = false)
+    public static function addBalance($shop, $amount, $order, $tx, $fix = false)
     {
-        $shop->balance += $amount;
+        //门店余额增加
+        $currentBalance = bcadd($shop->balance, $amount, 2);
+        $shop->balance = $currentBalance;
         $shop->totalRecharge += $amount;
+        //定向消费余额
         if ($fix) {
-            $shop->fixBalance += $amount;
+            $currentFix = bcadd($shop->fixBalance, $amount, 2);
+            $shop->fixBalance = $currentFix;
+        }
+        $currentTx = $shop->txBalance;
+        //提现余额
+        if ($tx == dict::getDict('yeTx', 'can')) {
+            $currentTx = bcadd($shop->txBalance, $amount, 2);
+            $shop->txBalance = $currentTx;
         }
         $shop->save();
+
+        //增加余额变动记录
+        $capitalType = $order->capitalType;
+        $id = $order->id;
+        $change = [
+            'relateId' => $id,
+            'capitalType' => $capitalType,
+            'amount' => $order->actPrice,
+            'balance' => $currentBalance,
+            'txBalance' => $currentTx,
+            'io' => 1,
+            'payWay' => $order->payWay,
+            'event' => "充值(订单:{$order->orderSn})",
+            'sjId' => $order->sjId,
+            'shopId' => $order->shopId,
+            'tx' => $tx,
+        ];
+        ShopYeChangeClass::addChange($change, true);
+
+        //平台余额增加
+        PtAssetClass::addBalance($shop, $amount, $order, $tx);
+
     }
 
 }

+ 28 - 26
biz-hd/purchase/classes/PurchaseClearClass.php

@@ -30,7 +30,7 @@ class PurchaseClearClass extends BaseClass
         if (empty($arr)) {
             util::fail('请选择采购单');
         }
-        $purchaseList = PurchaseClass::getAllByCondition(['id' => ['in', $arr]], null, ['id', 'actPrice', 'debt','ghsId'], null, true);
+        $purchaseList = PurchaseClass::getAllByCondition(['id' => ['in', $arr]], null, ['id', 'actPrice', 'debt', 'ghsId'], null, true);
         if (empty($purchaseList)) {
             util::fail('请选择采购单');
         }
@@ -105,32 +105,34 @@ class PurchaseClearClass extends BaseClass
         $ghs->save();
 
         //供货商的门店余额增加
-        $shopId = $ghs->shopId;
-        $shop = ShopClass::getLockById($shopId);
-        if (empty($shop)) {
-            util::fail('没有找到门店');
+        if ($payWay == dict::getDict('payWay', 'wxPay')) {
+            $shopId = $ghs->shopId;
+            $shop = ShopClass::getLockById($shopId);
+            if (empty($shop)) {
+                util::fail('没有找到门店');
+            }
+            $balance = bcadd($shop->balance, $order->actPrice, 2);
+            $txBalance = bcadd($shop->txBalance, $order->actPrice, 2);
+            $shop->balance = $balance;
+            $shop->txBalance = $txBalance;
+            $shop->save();
+
+            $capitalType = dict::getDict('capitalType', 'hdPurchaseClear', 'id');
+            $change = [
+                'relateId' => $clearId,
+                'capitalType' => $capitalType,
+                'amount' => $order->actPrice,
+                'balance' => $balance,
+                'txBalance' => $txBalance,
+                'io' => 1,
+                'payWay' => $order->payWay,
+                'event' => "客户欠款结帐(订单:{$order->orderSn})",
+                'sjId' => $order->sjId,
+                'shopId' => $order->shopId,
+                'tx' => dict::getDict('yeTx', 'can'),
+            ];
+            ShopYeChangeClass::addChange($change, true);
         }
-        $balance = bcadd($shop->balance, $order->actPrice, 2);
-        $txBalance = bcadd($shop->txBalance, $order->actPrice, 2);
-        $shop->balance = $balance;
-        $shop->txBalance = $txBalance;
-        $shop->save();
-
-        $capitalType = dict::getDict('capitalType', 'hdPurchaseClear', 'id');
-        $change = [
-            'relateId' => $clearId,
-            'capitalType' => $capitalType,
-            'amount' => $order->actPrice,
-            'balance' => $balance,
-            'txBalance' => $txBalance,
-            'io' => 1,
-            'payWay' => $order->payWay,
-            'event' => "欠款单结清(订单:{$order->orderSn})",
-            'sjId' => $order->sjId,
-            'shopId' => $order->shopId,
-            'tx' => ShopYeChangeClass::TX_CAN,
-        ];
-        ShopYeChangeClass::addChange($change, true);
 
         if (empty($arr)) {
             $msg = "结算订单 orderSn:{$orderSn} 支付成功,回调处理,没有找到采购订单";

+ 3 - 3
biz-hd/purchase/services/PurchaseService.php

@@ -169,7 +169,7 @@ class PurchaseService extends BaseService
         self::payAfter($info, $payWay);
         $saleId = $info->saleId ?? 0;
         $order = OrderClass::getById($saleId, true);
-        OrderService::payAfter($order, $payWay);
+        OrderService::payAfter($order, $payWay, true);
     }
 
     //余额支付 ssh 2021.1.24
@@ -180,7 +180,7 @@ class PurchaseService extends BaseService
 
         $saleId = $info->saleId ?? 0;
         $order = OrderClass::getById($saleId, true);
-        OrderService::payAfter($order, $payWay);
+        OrderService::payAfter($order, $payWay, true);
     }
 
     //采购订单支付成功后回调处理流程
@@ -201,7 +201,7 @@ class PurchaseService extends BaseService
 
         $saleId = $info->saleId ?? 0;
         $order = OrderClass::getById($saleId, true);
-        OrderService::payAfter($order, $payWay);
+        OrderService::payAfter($order, $payWay, true);
     }
 
     //第三方支付、余额支付和欠款支付后调用的流程 shish 2021.4.27

+ 133 - 0
biz/pt/classes/PtAssetClass.php

@@ -0,0 +1,133 @@
+<?php
+
+namespace biz\pt\classes;
+
+use biz\base\classes\BaseClass;
+use common\components\dict;
+use common\components\util;
+
+class PtAssetClass extends BaseClass
+{
+
+    public static $baseFile = '\biz\pt\models\PtAsset';
+
+    //平台余额增加 shish 20210519
+    public static function addBalance($shop, $amount, $order, $tx)
+    {
+        $ptStyle = $shop->ptStyle;
+        if ($ptStyle == dict::getDict('ptStyle', 'hd')) {
+            $asset = self::getHdBalance();
+        } elseif ($ptStyle == dict::getDict('ptStyle', 'ghs')) {
+            $asset = self::getGhsBalance();
+        } else {
+            util::fail('没有找到平台');
+        }
+        $currentAmount = bcadd($asset->amount, $amount, 2);
+        $asset->amount = $currentAmount;
+        $asset->save();
+
+        if ($ptStyle == dict::getDict('ptStyle', 'hd')) {
+            $txAsset = self::getHdTxBalance();
+        } elseif ($ptStyle == dict::getDict('ptStyle', 'ghs')) {
+            $txAsset = self::getGhsTxBalance();
+        } else {
+            util::fail('没有找到平台');
+        }
+        $currentTxBalance = $txAsset->amount;
+        if ($tx == dict::getDict('yeTx', 'can')) {
+            $currentTxBalance = bcadd($currentTxBalance, $amount, 2);
+            $txAsset->amount = $currentTxBalance;
+            $txAsset->save();
+        }
+
+        $id = $order->id;
+        $capitalType = $order->capitalType;
+        $change = [
+            'relateId' => $id,
+            'capitalType' => $capitalType,
+            'amount' => $order->actPrice,
+            'balance' => $currentAmount,
+            'txBalance' => $currentTxBalance,
+            'io' => 1,
+            'payWay' => $order->payWay,
+            'event' => "商家 {$shop->merchantName} {$shop->shopName} 充值(订单:{$order->orderSn})",
+            'sjId' => $order->sjId,
+            'shopId' => $order->shopId,
+            'tx' => $tx,
+        ];
+        PtYeChangeClass::addChange($change, true);
+    }
+
+    //零售平台余额对象 shish 20210519
+    public static function getHdBalance()
+    {
+        $hd = dict::getDict('hdBalance');
+        $id = $hd['id'];
+        $name = $hd['name'];
+        $asset = self::getLockById($id);
+        if (empty($asset)) {
+            $data = ['id' => $id, 'name' => $name, 'amount' => 0.00];
+            self::add($data);
+            $asset = self::getLockById($id);
+            if (empty($asset)) {
+                util::fail('没有找到零售平台余额,请先创建');
+            }
+        }
+        return $asset;
+    }
+
+    //供货商平台余额对象 shish 20210519
+    public static function getGhsBalance()
+    {
+        $ghs = dict::getDict('ghsBalance');
+        $id = $ghs['id'];
+        $name = $ghs['name'];
+        $asset = self::getLockById($id);
+        if (empty($asset)) {
+            $data = ['id' => $id, 'name' => $name, 'amount' => 0.00];
+            self::add($data);
+            $asset = self::getLockById($id);
+            if (empty($asset)) {
+                util::fail('没有找到供货商平台余额,请先创建');
+            }
+        }
+        return $asset;
+    }
+
+    //零售平台余额对象 shish 20210519
+    public static function getHdTxBalance()
+    {
+        $txHd = dict::getDict('hdTxBalance');
+        $id = $txHd['id'];
+        $name = $txHd['name'];
+        $asset = self::getLockById($id);
+        if (empty($asset)) {
+            $data = ['id' => $id, 'name' => $name, 'amount' => 0.00];
+            self::add($data);
+            $asset = self::getLockById($id);
+            if (empty($asset)) {
+                util::fail('没有找到零售平台可提现余额,请先创建');
+            }
+        }
+        return $asset;
+    }
+
+    //供货商平台余额对象 shish 20210519
+    public static function getGhsTxBalance()
+    {
+        $txGhs = dict::getDict('ghsTxBalance');
+        $id = $txGhs['id'];
+        $name = $txGhs['name'];
+        $asset = self::getLockById($id);
+        if (empty($asset)) {
+            $data = ['id' => $id, 'name' => $name, 'amount' => 0.00];
+            self::add($data);
+            $asset = self::getLockById($id);
+            if (empty($asset)) {
+                util::fail('没有找到供货商平台可提现余额,请先创建');
+            }
+        }
+        return $asset;
+    }
+
+}

+ 20 - 0
biz/pt/classes/PtYeChangeClass.php

@@ -0,0 +1,20 @@
+<?php
+
+namespace biz\pt\classes;
+
+use biz\base\classes\BaseClass;
+use common\components\dict;
+use common\components\util;
+
+class PtYeChangeClass extends BaseClass
+{
+
+    public static $baseFile = '\biz\pt\models\PtYeChange';
+
+    //新增变动 shish 20210519
+    public static function addChange($change, $returnObj)
+    {
+        return self::add($change, $returnObj);
+    }
+
+}

+ 15 - 0
biz/pt/models/PtAsset.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace biz\pt\models;
+
+use biz\base\models\Base;
+
+class PtAsset extends Base
+{
+
+    public static function tableName()
+    {
+        return 'xhPtAsset';
+    }
+
+}

+ 15 - 0
biz/pt/models/PtYeChange.php

@@ -0,0 +1,15 @@
+<?php
+
+namespace biz\pt\models;
+
+use biz\base\models\Base;
+
+class PtYeChange extends Base
+{
+
+    public static function tableName()
+    {
+        return 'xhPtYeChange';
+    }
+
+}

+ 12 - 0
biz/pt/services/PtAssetService.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace biz\pt\services;
+
+use biz\base\services\BaseService;
+
+class PtAssetService extends BaseService
+{
+
+    public static $baseFile = '\biz\pt\classes\PtAsset';
+
+}

+ 12 - 0
biz/pt/services/PtYeChangeService.php

@@ -0,0 +1,12 @@
+<?php
+
+namespace biz\pt\services;
+
+use biz\base\services\BaseService;
+
+class PtYeChangeService extends BaseService
+{
+
+    public static $baseFile = '\biz\pt\classes\PtYeChange';
+
+}

+ 6 - 2
biz/recharge/classes/RechargeClass.php

@@ -3,8 +3,10 @@
 namespace biz\recharge\classes;
 
 use biz\base\classes\BaseClass;
+use biz\shop\classes\ShopYeChangeClass;
 use biz\sj\classes\SjClass;
 use bizHd\merchant\classes\ShopClass;
+use common\components\dict;
 use common\components\noticeUtil;
 use common\components\orderSn;
 
@@ -38,13 +40,15 @@ class RechargeClass extends BaseClass
         $recharge->save();
         $orderSn = $recharge->orderSn;
         $shopId = $recharge->shopId;
-        $shop = ShopClass::getById($shopId, true);
+        $shop = ShopClass::getLockById($shopId);
         if (empty($shop)) {
             noticeUtil::push("充值支付回调通知,没有找到门店 orderSn:{$orderSn}");
             return false;
         }
         $amount = $recharge->amount;
-        ShopClass::addBalance($shop, $amount);
+        //门店和平台余额增加
+        $tx = dict::getDict('yeTx', 'canNot');
+        ShopClass::addBalance($shop, $amount, $recharge, $tx);
 
         if ($rechargeRenew == 1) {
             $sjId = $recharge->sjId;

+ 3 - 0
biz/shop/classes/ShopClass.php

@@ -80,6 +80,9 @@ class ShopClass extends BaseClass
             $img = json_encode($data['img']);
         }
         $data['img'] = $img;
+        if (isset($data['ptStyle']) == false) {
+            util::fail('请先择平台类型');
+        }
         $shop = self::add($data);
         $newShopId = $shop['id'];
         //初始化花材 linqh 2021.5.11

+ 0 - 4
biz/shop/classes/ShopYeChangeClass.php

@@ -2,7 +2,6 @@
 
 namespace biz\shop\classes;
 
-use Yii;
 use biz\base\classes\BaseClass;
 
 class ShopYeChangeClass extends BaseClass
@@ -10,9 +9,6 @@ class ShopYeChangeClass extends BaseClass
 
     public static $baseFile = '\biz\shop\models\ShopYeChange';
 
-    const TX_CAN_NOT = 1;
-    const TX_CAN = 2;
-
     public static function addChange($change, $returnObj = false)
     {
         return self::add($change, $returnObj);

+ 4 - 2
biz/sj/services/MerchantService.php

@@ -23,6 +23,7 @@ use bizHd\wx\classes\WxOpenClass;
 use bizHd\wx\services\WxMenuService;
 use biz\sj\classes\MerchantInitClass;
 use common\components\business;
+use common\components\dict;
 use common\components\stringUtil;
 use common\components\util;
 use common\services\xhTMessageService;
@@ -75,8 +76,7 @@ class MerchantService extends BaseService
         $applyData['address'] = $applyData['address'] ?? '';
         $applyData['agentLevel'] = 1;
         $applyData['parentId'] = $applyData['introSjId'] ?? 0;
-        //15天免费试用
-        //区分供货商(一年) 零售商(15天)
+        //免费试用,区分供货商(一年) 零售商(15天)
         $deadline = time() + 7 * 86400; //默认其他
         if ($applyData['style'] == SjClass::STYLE_RETAIL) {
             $deadline = time() + 15 * 86400; //零售商(15天)
@@ -91,6 +91,7 @@ class MerchantService extends BaseService
         $sjId = $sj['id'];
         $sjName = $sj['name'] ?? 0;
         $mobile = $applyData['mobile'] ?? '';
+        $ptStyle = $applyData['style'] ?? dict::getDict('ptStyle', 'hd');
 
         if (!empty($applyId)) {
             ApplyClass::updateById($applyId, ['sjId' => $sjId]);
@@ -163,6 +164,7 @@ class MerchantService extends BaseService
             'fullAddress' => $applyData['fullAddress'] ?? '',
             'lat' => $applyData['lat'] ?? '',
             'long' => $applyData['long'] ?? '',
+            'ptStyle' => $ptStyle,
         ];
         $shopRespond = \biz\shop\classes\ShopClass::addShop($shopData);
         $shopId = $shopRespond['id'];

+ 22 - 0
common/components/dict.php

@@ -9,6 +9,21 @@ class dict
 
     public static $data = [
 
+        //余额提现
+        'yeTx' => [
+            //不可以
+            'canNot' => 1,
+            //可以
+            'can' => 2,
+        ],
+
+        'ptAsset' => [
+            'hdBalance' => ['id' => 1, 'name' => '零售平台余额'],
+            'ghsBalance' => ['id' => 2, 'name' => '供货商平台余额'],
+            'hdTxBalance' => ['id' => 3, 'name' => '零售平台可提现余额'],
+            'ghsTxBalance' => ['id' => 4, 'name' => '供货商平台可提现余额'],
+        ],
+
         //采购和销售单的有效期
         'sale_purchase_order_valid' => 180,
 
@@ -37,6 +52,13 @@ class dict
             ['name' => '今年', 'value' => 'thisYear',],
         ],
 
+        //所属平台类型
+        'ptStyle' => [
+            'hd' => 1,
+            'ghs' => 2,
+            'kmGhs' => 3,
+        ],
+
         'merchantStatus' => ['checking' => 0, 'pass' => 1, 'noPass' => 2, 'freeze' => 3, 'unfreeze' => 4, 'shut' => 5],
 
         //涨价方式

+ 36 - 1
sql.sql

@@ -2595,4 +2595,39 @@ ALTER TABLE xhClear ADD payWay TINYINT NOT NULL DEFAULT 0 COMMENT '支付方式
 ----linqh  2021.5.18
 ALTER TABLE `xhGhsStockOutOrderItem`
 MODIFY COLUMN `itemStock`  decimal(10,2) NOT NULL DEFAULT 0.00 COMMENT '当时的库存(变更前)' AFTER `itemNum`,
-ADD COLUMN `newStock`  decimal(10,2) NOT NULL DEFAULT 0 COMMENT '变更后的库存' AFTER `itemPrice`;
+ADD COLUMN `newStock`  decimal(10,2) NOT NULL DEFAULT 0 COMMENT '变更后的库存' AFTER `itemPrice`;
+
+-----shish 20210519
+DROP TABLE IF EXISTS `xhPtAsset`;
+CREATE TABLE IF NOT EXISTS `xhPtAsset`(
+id INT NOT NULL AUTO_INCREMENT PRIMARY KEY COMMENT '自增id',
+amount DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '金额'
+)COMMENT='平台资产';
+DROP TABLE IF EXISTS `xhPtYeChange`;
+CREATE TABLE IF EXISTS `xhPtYeChange` (
+  `id` INT(11) NOT NULL AUTO_INCREMENT,
+  `style` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '平台类型 1花店 2供货商',
+  `relateId` INT(11) NOT NULL DEFAULT '0' COMMENT '关联订单id',
+  `capitalType` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '流水类型',
+  `amount` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '变动金额',
+  `balance` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '当前余额',
+  `txBalance` DECIMAL(9,2) NOT NULL DEFAULT '0.00' COMMENT '当前可提现余额',
+  `tx` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '本条变动的余额 1不可提现 2可提现',
+  `io` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '类型 0减少 1增加',
+  `payWay` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '支付方式',
+  `fromType` TINYINT(4) NOT NULL DEFAULT '0' COMMENT '来源 1门店 2商城 3朋友圈 请查看dict.php文件',
+  `event` VARCHAR(50) NOT NULL DEFAULT '' COMMENT '事项',
+  `sjId` INT(11) NOT NULL DEFAULT '0' COMMENT '商家id',
+  `shopId` INT(11) NOT NULL DEFAULT '0' COMMENT '门店id',
+  `remark` VARCHAR(500) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT '备注',
+  `addTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '添加时间',
+  `updateTime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
+  PRIMARY KEY (`id`)
+) COMMENT='平台余额变化记录';
+ALTER TABLE `xhPtYeChange` ADD INDEX `search`(`style`,`sjId`,`shopId`);
+ALTER TABLE `xhPtAsset` ADD `name` VARCHAR(30) NOT NULL DEFAULT '' COMMENT '资产名称' AFTER `id`;
+ALTER TABLE xhShop ADD sjStyle TINYINT NOT NULL DEFAULT 1 COMMENT '商家类型 1花店 2供货商 3昆明供货商' AFTER `merchantId`;
+ALTER TABLE xhShop CHANGE sjStyle ptStyle TINYINT NOT NULL DEFAULT 1 COMMENT '所属平台 1花店 2供货商 请查看dict.php';
+INSERT INTO xhPtAsset VALUES(1,'零售平台余额',0.00),(2,'供货商平台余额',0.00),(3,'零售平台可提现余额',0.00),(4,'供货商平台可提现余额',0.00);
+ALTER TABLE xhPtYeChange MODIFY `tx` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '本条变动的余额 1不可提现 2可提现 请查看dict.php yeTx';
+ALTER TABLE xhShopYeChange MODIFY `tx` TINYINT(4) NOT NULL DEFAULT '1' COMMENT '本条变动的余额 1不可提现 2可提现 请查看dict.php yeTx';