|
|
@@ -36,6 +36,28 @@ class PurchaseController extends BaseController
|
|
|
|
|
|
public $guestAccess = ['detail', 'ali-pay', 'get-ali-pay-code', 'wx-pay'];
|
|
|
|
|
|
+ //取消采购单 ssh 20250710
|
|
|
+ public function actionCancel()
|
|
|
+ {
|
|
|
+ $get = Yii::$app->request->get();
|
|
|
+ $id = $get['id'] ?? '';
|
|
|
+ $info = PurchaseClass::getById($id, true);
|
|
|
+ if (empty($info)) {
|
|
|
+ util::fail('没有找到采购单');
|
|
|
+ }
|
|
|
+ if (!isset($info->mainId) || $info->mainId != $this->mainId) {
|
|
|
+ util::fail('访问错误');
|
|
|
+ }
|
|
|
+ if ($info->status == 5) {
|
|
|
+ util::fail('已取消');
|
|
|
+ }
|
|
|
+ if ($info->status != 1) {
|
|
|
+ util::fail('不能取消');
|
|
|
+ }
|
|
|
+ PurchaseService::expire($info);
|
|
|
+ util::complete('已取消');
|
|
|
+ }
|
|
|
+
|
|
|
//获取支付宝付款码 ssh 20240713
|
|
|
public function actionGetAliPayCode()
|
|
|
{
|
|
|
@@ -593,20 +615,20 @@ class PurchaseController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(isset($ghsInfo['home'])){
|
|
|
- if($ghsInfo['home'] == 0){
|
|
|
+ if (isset($ghsInfo['home'])) {
|
|
|
+ if ($ghsInfo['home'] == 0) {
|
|
|
util::fail('暂不支持送货上门,请选其它配送方式');
|
|
|
}
|
|
|
- if(!empty($ghsInfo['homeAmount'])){
|
|
|
- $homeType = $ghsInfo['homeType']??0;
|
|
|
+ if (!empty($ghsInfo['homeAmount'])) {
|
|
|
+ $homeType = $ghsInfo['homeType'] ?? 0;
|
|
|
$homeAmount = floatval($ghsInfo['homeAmount']);
|
|
|
- if($homeType == 0){
|
|
|
- if($homeAmount>$respond->actPrice){
|
|
|
+ if ($homeType == 0) {
|
|
|
+ if ($homeAmount > $respond->actPrice) {
|
|
|
util::fail("满{$homeAmount}元 可送货上门");
|
|
|
}
|
|
|
}
|
|
|
- if($homeType == 1){
|
|
|
- if ($homeAmount>$respond->bigNum) {
|
|
|
+ if ($homeType == 1) {
|
|
|
+ if ($homeAmount > $respond->bigNum) {
|
|
|
util::fail("满{$homeAmount}扎 可送货上门");
|
|
|
}
|
|
|
}
|
|
|
@@ -720,7 +742,7 @@ class PurchaseController extends BaseController
|
|
|
if (isset($cg->book) && $cg->book == 0) {
|
|
|
$ghsShopId = $ghs['shopId'] ?? 0;
|
|
|
if (getenv('YII_ENV') == 'production') {
|
|
|
- $specialList = [10649, 8042, 16454, 21319, 33668,42345];
|
|
|
+ $specialList = [10649, 8042, 16454, 21319, 33668, 42345];
|
|
|
} else {
|
|
|
$specialList = [36523];
|
|
|
}
|