|
|
@@ -16,6 +16,27 @@ class OrderItemController extends BaseController
|
|
|
|
|
|
public $guestAccess = [];
|
|
|
|
|
|
+ //修改预订单花材的数量和价格
|
|
|
+ public function actionModifyBookItem()
|
|
|
+ {
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $id = $post['id'] ?? 0;
|
|
|
+ $order = OrderClass::getById($id, true);
|
|
|
+ if (empty($order)) {
|
|
|
+ util::fail('没有订单');
|
|
|
+ }
|
|
|
+ if ($order->mainId != $this->mainId) {
|
|
|
+ util::fail('不是你的订单哦');
|
|
|
+ }
|
|
|
+ if ($order->stockChange == 1) {
|
|
|
+ util::fail('已经入库,不能修改');
|
|
|
+ }
|
|
|
+ if ($order->status != 2) {
|
|
|
+ util::fail('待发货订单才能修改');
|
|
|
+ }
|
|
|
+ util::complete();
|
|
|
+ }
|
|
|
+
|
|
|
//删除花材 ssh 20240123
|
|
|
public function actionDelItem()
|
|
|
{
|
|
|
@@ -32,6 +53,9 @@ class OrderItemController extends BaseController
|
|
|
if ($order->book == 0) {
|
|
|
util::fail('不是预订单');
|
|
|
}
|
|
|
+ if ($order->mainId != $this->mainId) {
|
|
|
+ util::fail('不是你的订单');
|
|
|
+ }
|
|
|
if (floatval($order->actPrice) != 0) {
|
|
|
util::fail('订单金额不是0');
|
|
|
}
|