|
|
@@ -9,177 +9,193 @@ 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.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;
|
|
|
+ }
|
|
|
+
|
|
|
}
|