| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201 |
- <?php
- namespace common\components;
- use bizGhs\order\classes\OrderClass;
- use bizHd\purchase\classes\PurchaseClearSnClass;
- use biz\recharge\classes\RechargeSnClass;
- use bizGhs\check\classes\CheckSnClass;
- use bizGhs\order\classes\OrderSnClass;
- use bizGhs\order\classes\PurchaseSnClass;
- use bizHd\px\classes\PxApplySnClass;
- use bizMall\renew\classes\RenewSnClass;
- use Yii;
- use yii\imagine\Image;
- //订单号生成 shish 2021.1.19
- class orderSn
- {
- //供货商订单号生成 shish 2021.1.19
- public static function getGhsOrderSn()
- {
- $prefix = 'XSD_CS';
- if (getenv('YII_ENV', 'local') == 'production') {
- $prefix = 'XSD';
- }
- $respond = OrderSnClass::add(['id' => null]);
- $id = $respond['id'] ?? 0;
- if (empty($id)) {
- util::fail('订单号没有生成');
- }
- return $prefix . $id;
- }
- //零售商订单号生成 shish 2021.1.19
- public static function getOrderSn()
- {
- $prefix = 'KD_CS';
- if (getenv('YII_ENV', 'local') == 'production') {
- $prefix = 'KD';
- }
- $respond = \bizHd\order\classes\OrderSnClass::add(['id' => null]);
- $id = $respond['id'] ?? 0;
- if (empty($id)) {
- util::fail('订单号没有生成');
- }
- return $prefix . $id;
- }
- //供货商采购单号 shish 2021.1.19
- public static function getGhsPurchaseSn()
- {
- $prefix = 'PH_CS';
- if (getenv('YII_ENV', 'local') == 'production') {
- $prefix = 'PH';
- }
- $respond = PurchaseSnClass::add(['id' => null]);
- $id = $respond['id'] ?? 0;
- if (empty($id)) {
- util::fail('采购单号没有生成');
- }
- return $prefix . $id;
- }
- //供货商盘点单号 shish 2021.1.19
- public static function getGhsCheckSn()
- {
- $prefix = 'PD_CS';
- if (getenv('YII_ENV', 'local') == 'production') {
- $prefix = 'PD';
- }
- $respond = CheckSnClass::add(['id' => null]);
- $id = $respond['id'] ?? 0;
- if (empty($id)) {
- util::fail('盘点单号没有生成');
- }
- return $prefix . $id;
- }
- //零售商采购单号 shish 2021.1.19
- public static function getPurchaseSn()
- {
- $prefix = 'CG_CS';
- if (getenv('YII_ENV', 'local') == 'production') {
- $prefix = 'CG';
- }
- $respond = \bizHd\purchase\classes\PurchaseSnClass::add(['id' => null]);
- $id = $respond['id'] ?? 0;
- if (empty($id)) {
- util::fail('采购单号没有生成');
- }
- return $prefix . $id;
- }
- //零售商采购单号 shish 2021.1.19
- public static function getPurchaseClearSn()
- {
- $prefix = 'PC_CS';
- if (getenv('YII_ENV', 'local') == 'production') {
- $prefix = 'PC';
- }
- $respond = PurchaseClearSnClass::add(['id' => null]);
- $id = $respond['id'] ?? 0;
- if (empty($id)) {
- util::fail('单号没有生成');
- }
- return $prefix . $id;
- }
- //供货商入库订单号 linqh 2021.1.23
- public static function getGhsStockInSn()
- {
- $prefix = 'RK_CS';
- if (getenv('YII_ENV', 'local') == 'production') {
- $prefix = 'RK';
- }
- $respond = \bizGhs\order\classes\StockInSnClass::add(['id' => null]);
- $id = $respond['id'] ?? 0;
- if (empty($id)) {
- util::fail('入库单号没有生成');
- }
- return $prefix . $id;
- }
- //供货商出库订单号 linqh 2021.1.23
- public static function getGhsStockOutSn()
- {
- $prefix = 'CK_CS';
- if (getenv('YII_ENV', 'local') == 'production') {
- $prefix = 'CK';
- }
- $respond = \bizGhs\order\classes\StockOutSnClass::add(['id' => null]);
- $id = $respond['id'] ?? 0;
- if (empty($id)) {
- util::fail('出库单号没有生成');
- }
- return $prefix . $id;
- }
- //充值单号 shish 2021.2.20
- public static function getRechargeSn()
- {
- $prefix = 'CZ_CS';
- if (getenv('YII_ENV', 'local') == 'production') {
- $prefix = 'CZ';
- }
- $respond = RechargeSnClass::add(['id' => null]);
- $id = $respond['id'] ?? 0;
- if (empty($id)) {
- util::fail('充值单号没有生成');
- }
- return $prefix . $id;
- }
- //供货商批量结算订单号 shish 2021.3.15
- public static function getGhsOrderClearSn()
- {
- // BOC batchOrderClear
- $prefix = 'BOC_CS';
- if (getenv('YII_ENV', 'local') == 'production') {
- $prefix = 'BOC';
- }
- $respond = OrderClass::add(['id' => null]);
- $id = $respond['id'] ?? 0;
- if (empty($id)) {
- util::fail('订单号没有生成');
- }
- return $prefix . $id;
- }
- //培训报名订单号 shish 2021.3.17
- public static function getPxApplySn()
- {
- $prefix = 'PX_CS';
- if (getenv('YII_ENV', 'local') == 'production') {
- $prefix = 'PX';
- }
- $respond = PxApplySnClass::add(['id' => null]);
- $id = $respond['id'] ?? 0;
- if (empty($id)) {
- util::fail('订单号没有生成');
- }
- return $prefix . $id;
- }
- //获取花店续费订单号 shish 2021.3.24
- public static function getRenewSn()
- {
- $prefix = 'RN_CS';
- if (getenv('YII_ENV', 'local') == 'production') {
- $prefix = 'RN';
- }
- $respond = RenewSnClass::add(['id' => null]);
- $id = $respond['id'] ?? 0;
- if (empty($id)) {
- util::fail('订单号没有生成');
- }
- return $prefix . $id;
- }
- }
|