|
|
@@ -15,12 +15,20 @@ class PurchaseClass extends BaseClass
|
|
|
|
|
|
public static $baseFile = '\biz\purchase\models\Purchase';
|
|
|
|
|
|
+ //订单状态 1待付款,待确认,2待配送,3配送中,4已完成
|
|
|
+ const STATUS_UN_PAY = 1;
|
|
|
+ const STATUS_UN_SEND = 2;
|
|
|
+ const STATUS_SENDING = 3;
|
|
|
+ const STATUS_COMPLETE = 4;
|
|
|
+
|
|
|
//添加采购 shish 2021.1.18
|
|
|
public static function addPurchase($data)
|
|
|
{
|
|
|
$orderSn = orderSn::getPurchaseSn();
|
|
|
$data['orderSn'] = $orderSn;
|
|
|
- self::add($data);
|
|
|
+ $data['prePrice'] = 0.01;
|
|
|
+ $data['actPrice'] = 0.01;
|
|
|
+ $respond = self::add($data);
|
|
|
if (isset($data['product']) == false || empty($data['product'])) {
|
|
|
util::fail('请选择花材');
|
|
|
}
|
|
|
@@ -34,16 +42,42 @@ class PurchaseClass extends BaseClass
|
|
|
$ghsShopId = $data['ghsShopId'] ?? 0;
|
|
|
$ghsShop = \bizGhs\merchant\classes\ShopClass::getById($ghsShopId);
|
|
|
$ghsId = $ghsShop['merchantId'] ?? 0;
|
|
|
+ if (empty($ghsId)) {
|
|
|
+ util::fail('没有找到供货商');
|
|
|
+ }
|
|
|
|
|
|
+ //供货商增加订单
|
|
|
$orderData = [
|
|
|
'prePrice' => 0.01,
|
|
|
'actPrice' => 0.01,
|
|
|
'num' => 1,
|
|
|
'smallNum' => 3,
|
|
|
- 'product' => $productList
|
|
|
+ 'product' => $productList,
|
|
|
+ 'merchantId' => $ghsId,
|
|
|
];
|
|
|
\bizGhs\order\classes\OrderClass::addOrder($orderData);
|
|
|
|
|
|
+ return $respond;
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取采购单信息 shish 2021.1.24
|
|
|
+ public static function getInfo($id)
|
|
|
+ {
|
|
|
+ return self::getById($id);
|
|
|
+ }
|
|
|
+
|
|
|
+ //订单延期支付 shish 2021.1.24
|
|
|
+ public static function debt($info)
|
|
|
+ {
|
|
|
+ if (isset($info['status']) == false || $info['status'] != self::STATUS_UN_PAY) {
|
|
|
+ util::fail('请确认订单状态');
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //余额支付 shish 2021.1.24
|
|
|
+ public static function balancePay($info)
|
|
|
+ {
|
|
|
+
|
|
|
}
|
|
|
|
|
|
}
|