|
|
@@ -19,12 +19,42 @@ class OrderItemController extends BaseController
|
|
|
//删除花材 ssh 20240123
|
|
|
public function actionDelItem()
|
|
|
{
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $id = $post['id'] ?? 0;
|
|
|
+ $smallId = $post['smallId'] ?? 0;
|
|
|
+ $order = OrderClass::getById($id, true);
|
|
|
+ if (empty($order)) {
|
|
|
+ util::fail('没有订单');
|
|
|
+ }
|
|
|
+ if ($order->book == 0) {
|
|
|
+ util::fail('不是预订单');
|
|
|
+ }
|
|
|
+ if (floatval($order->actPrice) != 0) {
|
|
|
+ util::fail('订单金额不是0');
|
|
|
+ }
|
|
|
+
|
|
|
util::complete('删除成功');
|
|
|
}
|
|
|
|
|
|
//添加花材
|
|
|
public function actionAddItem()
|
|
|
{
|
|
|
+ $post = Yii::$app->request->post();
|
|
|
+ $id = $post['id'] ?? 0;
|
|
|
+ $data = $post['data'] ?? 0;
|
|
|
+ $arr = json_decode($data, true);
|
|
|
+ $order = OrderClass::getById($id, true);
|
|
|
+ if (empty($order)) {
|
|
|
+ util::fail('没有订单');
|
|
|
+ }
|
|
|
+ if ($order->book == 0) {
|
|
|
+ util::fail('不是预订单');
|
|
|
+ }
|
|
|
+ if (floatval($order->actPrice) != 0) {
|
|
|
+ util::fail('订单金额不是0');
|
|
|
+ }
|
|
|
+ print_r($arr);
|
|
|
+ die;
|
|
|
util::complete('添加成功');
|
|
|
}
|
|
|
|