From c8a31e44a5511bf98d8c8a42097ae5c8be0ec07e Mon Sep 17 00:00:00 2001 From: zhaocheng <578322713@qq.com> Date: Wed, 6 Nov 2019 17:12:54 +0800 Subject: [PATCH 1/9] =?UTF-8?q?=E7=A4=BC=E5=93=81=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E7=A1=AE=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/controllers/InsurerController.php | 41 +++++++++++++++++++++- frontend/views/insurer/my-list-info.php | 23 ++++++++++-- 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/frontend/controllers/InsurerController.php b/frontend/controllers/InsurerController.php index 3360495..2bee5f9 100644 --- a/frontend/controllers/InsurerController.php +++ b/frontend/controllers/InsurerController.php @@ -3502,6 +3502,45 @@ class InsurerController extends BaseController } return $result; } + + public function actionGiftCancel() + { + Yii::$app->response->format = Response::FORMAT_JSON; + + $request = Yii::$app->request; + $result = array(); + $result['success'] = false; + $result['msg'] = '保存失败'; + + if ($request->isPost) { + $id = $request->post('order_id', 0); + + $order_info = OrderT::findOne($id); + if (!$order_info) { + $result['msg'] = '订单不存在'; + return $result; + } + + $tran = OrderT::getDb()->beginTransaction(); + try { + // 删除礼品/券库信息 + GiftTicketTUse::deleteAll('order_id=' . $order_info->id); + // 修改订单礼品/券信息 + OrderGiftT::updateAll(['gift_src'=>''],['order_id'=>$order_info->id]); + // 修改订单状态 + $order_info->gift_status = 0; + $order_info->save(); + $result['success'] = true; + $result['msg'] = '保存成功'; + $tran->commit(); + } catch (\Exception $e) { + $tran->rollBack(); + $result['msg'] = $e->getMessage(); + } + } + return $result; + } + public function getGift($k, $v, $car_no, $order_info, $order_gift_id) { $result = array(); @@ -3565,7 +3604,7 @@ class InsurerController extends BaseController if ($shiwu_use) { $new_shiwu->gift_shuzi = $shiwu_use->gift_shuzi + 1; - $new_shiwu->code = sprintf("%04d", $gift_use->gift_shuzi + 1); + $new_shiwu->code = sprintf("%04d", $shiwu_use->gift_shuzi + 1); } else { $new_shiwu->gift_shuzi = 1; $new_shiwu->code = sprintf("%04d", 1); diff --git a/frontend/views/insurer/my-list-info.php b/frontend/views/insurer/my-list-info.php index 5a31651..ddcaa1e 100644 --- a/frontend/views/insurer/my-list-info.php +++ b/frontend/views/insurer/my-list-info.php @@ -195,8 +195,8 @@ use common\models\PriceT; 送单地址 - - + + @@ -213,6 +213,11 @@ use common\models\PriceT; 确认礼品 + gift_status == 1 && $my_id == 1) { ?> + + @@ -345,6 +350,20 @@ use common\models\PriceT; // }); }); + + $('.btn-cancel').click(function () { + parent.layer.confirm('此操作将回滚礼品状态,删除已生成礼物记录,确定继续?', { + btn: ['确认','取消'], //按钮 + shade: false //不显示遮罩 + }, function(){ + $.post('/insurer/gift-cancel',{order_id:id?>},function(data) { + parent.layer.msg(data.msg); + window.location.reload(); + }, 'json'); + }, function(){ + // + }); + }); }); endBlock(); ?> From 4b1e7ee6c64a8a195ac33eb622ea1673d97fafc3 Mon Sep 17 00:00:00 2001 From: zhaocheng <578322713@qq.com> Date: Wed, 6 Nov 2019 17:56:50 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=89=8D=E5=90=8E=E7=AB=AF=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20admin=20=E6=9D=83=E9=99=90=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/controllers/InsurerController.php | 4 +++- frontend/views/insurer/my-list-info.php | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/frontend/controllers/InsurerController.php b/frontend/controllers/InsurerController.php index 2bee5f9..980d2f9 100644 --- a/frontend/controllers/InsurerController.php +++ b/frontend/controllers/InsurerController.php @@ -3512,7 +3512,7 @@ class InsurerController extends BaseController $result['success'] = false; $result['msg'] = '保存失败'; - if ($request->isPost) { + if ($request->isPost && $this->my->id == 1) { $id = $request->post('order_id', 0); $order_info = OrderT::findOne($id); @@ -3537,6 +3537,8 @@ class InsurerController extends BaseController $tran->rollBack(); $result['msg'] = $e->getMessage(); } + }else { + $result['msg'] = '当前用户无此权限'; } return $result; } diff --git a/frontend/views/insurer/my-list-info.php b/frontend/views/insurer/my-list-info.php index ddcaa1e..5af01b9 100644 --- a/frontend/views/insurer/my-list-info.php +++ b/frontend/views/insurer/my-list-info.php @@ -350,7 +350,7 @@ use common\models\PriceT; // }); }); - + gift_status == 1 && $my_id == 1) { ?> $('.btn-cancel').click(function () { parent.layer.confirm('此操作将回滚礼品状态,删除已生成礼物记录,确定继续?', { btn: ['确认','取消'], //按钮 @@ -364,6 +364,7 @@ use common\models\PriceT; // }); }); + }); endBlock(); ?> From c94aec1e44101747d37cf80cba5670c2eb2448c9 Mon Sep 17 00:00:00 2001 From: zhaocheng <578322713@qq.com> Date: Wed, 6 Nov 2019 18:02:51 +0800 Subject: [PATCH 3/9] =?UTF-8?q?=E7=A4=BC=E5=88=B8=E7=BC=96=E7=A0=81?= =?UTF-8?q?=E8=BD=AC=E5=A4=A7=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/controllers/InsurerController.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/controllers/InsurerController.php b/frontend/controllers/InsurerController.php index 980d2f9..fb20bc7 100644 --- a/frontend/controllers/InsurerController.php +++ b/frontend/controllers/InsurerController.php @@ -3557,7 +3557,6 @@ class InsurerController extends BaseController //礼券 if ($gift_info && $gift_info->type_id == 2) { $pinyin_arr = explode(' ', $gift_info->pinyin_name); -// dd($pinyin_arr); $liquan_str = 'ch'; //获取礼券拼音首字母 foreach ($pinyin_arr as $first) { @@ -3575,13 +3574,12 @@ class InsurerController extends BaseController if ($gift_use) { $liquan_str .= sprintf("%04d", $gift_use->gift_shuzi + 1); $new_gift_use->gift_shuzi = $gift_use->gift_shuzi + 1; - $new_gift_use->code = $liquan_str; } else { $liquan_str .= sprintf("%04d", 1); $new_gift_use->gift_shuzi = 1; - $new_gift_use->code = strtoupper($liquan_str); } + $new_gift_use->code = strtoupper($liquan_str); $new_gift_use->op_id = $this->my->id; $new_gift_use->type_id = $v; //礼券ID $new_gift_use->input_date = date('Y-m-d H:i:s'); From 278c2507e27ddaa50cc63f9a663966e319ce7709 Mon Sep 17 00:00:00 2001 From: zengchaoxin Date: Thu, 7 Nov 2019 02:05:51 +0800 Subject: [PATCH 4/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/views/menu/edit.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/frontend/views/menu/edit.php b/frontend/views/menu/edit.php index a91852e..837769f 100644 --- a/frontend/views/menu/edit.php +++ b/frontend/views/menu/edit.php @@ -13,12 +13,12 @@ use \common\libs\MyLib;
- -
+ +
- -
+ +
- -
+ +
- -
+ +
From f75e27ce79360ed68267f8c9224e633a843b3ce9 Mon Sep 17 00:00:00 2001 From: zengchaoxin Date: Thu, 7 Nov 2019 02:12:26 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=9A=90=E8=97=8F?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E8=8F=9C=E5=8D=95=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/views/common/index.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/views/common/index.php b/frontend/views/common/index.php index 9eb75d2..554469c 100644 --- a/frontend/views/common/index.php +++ b/frontend/views/common/index.php @@ -91,6 +91,9 @@
退出 + + +
From 7cbd42849d483458be48a25d31ea3962963e3d0a Mon Sep 17 00:00:00 2001 From: zengchaoxin Date: Thu, 7 Nov 2019 02:14:36 +0800 Subject: [PATCH 6/9] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/views/common/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/views/common/index.php b/frontend/views/common/index.php index 554469c..a4a9689 100644 --- a/frontend/views/common/index.php +++ b/frontend/views/common/index.php @@ -91,7 +91,7 @@
退出 - +
From 654a12904803c81b67cc1f582b0f9a69296d7c15 Mon Sep 17 00:00:00 2001 From: zengchaoxin Date: Thu, 7 Nov 2019 02:17:26 +0800 Subject: [PATCH 7/9] =?UTF-8?q?=E6=81=A2=E5=A4=8D=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E5=88=86=E9=85=8D=E5=85=B3=E8=81=94=E5=8B=BE=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/views/permissions/permission.php | 123 +++++++++++++--------- 1 file changed, 72 insertions(+), 51 deletions(-) diff --git a/frontend/views/permissions/permission.php b/frontend/views/permissions/permission.php index b770c87..26400ce 100644 --- a/frontend/views/permissions/permission.php +++ b/frontend/views/permissions/permission.php @@ -2,71 +2,92 @@ use \common\libs\MyLib; ?> beginBlock('header_css'); ?> - + endBlock(); ?> -
-
-
-
- - - -
-
-
-
-
- -
-
-
-
- menus as $sub_item) { ?> +
+
+
+
+ + + +
+
+
-
+
- +
+
+ menus as $sub_item) { ?> +
+
+ +
+
+ +
-
- - -
-
-
- + + +
+
+
+ +
-
beginBlock('footer_js'); ?> - - - - + + + -endBlock(); ?> + +endBlock(); ?> \ No newline at end of file From 4159096e644d96f31b53e44b77e0fdc55387af5b Mon Sep 17 00:00:00 2001 From: zengchaoxin Date: Thu, 7 Nov 2019 02:18:27 +0800 Subject: [PATCH 8/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E9=85=8D?= =?UTF-8?q?=E6=9D=83=E9=99=90=E5=8A=9F=E8=83=BD=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/views/permissions/permission.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/views/permissions/permission.php b/frontend/views/permissions/permission.php index 26400ce..fba3055 100644 --- a/frontend/views/permissions/permission.php +++ b/frontend/views/permissions/permission.php @@ -12,11 +12,11 @@ use \common\libs\MyLib;
-
+
-
+
@@ -26,7 +26,7 @@ use \common\libs\MyLib;
menus as $sub_item) { ?>
-
+
@@ -40,7 +40,7 @@ use \common\libs\MyLib;
-
+
From dc3d11e3525b238530b5a4f26307390bfc786261 Mon Sep 17 00:00:00 2001 From: zengchaoxin Date: Thu, 7 Nov 2019 02:21:43 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=AA=E4=BA=BA?= =?UTF-8?q?=E6=8B=A8=E5=8F=B7=E8=84=9A=E6=9C=AC=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/controllers/CommonController.php | 5 ++++- frontend/views/common/call-phone.php | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/controllers/CommonController.php b/frontend/controllers/CommonController.php index 533e403..9f28501 100644 --- a/frontend/controllers/CommonController.php +++ b/frontend/controllers/CommonController.php @@ -385,6 +385,9 @@ class CommonController extends \yii\web\Controller } public function actionCallPhone() { - return $this->render('call-phone'); + $user_info = $this->my; + return $this->render('call-phone',[ + 'user_info' => $user_info + ]); } } diff --git a/frontend/views/common/call-phone.php b/frontend/views/common/call-phone.php index f5b9827..2c3bf1c 100644 --- a/frontend/views/common/call-phone.php +++ b/frontend/views/common/call-phone.php @@ -55,6 +55,7 @@ use \common\libs\MyLib; $(".btn-stop").click(function(){ sendMsg('ATH'); }); + wsInit(); })