diff --git a/service/Application/Admin/Controller/AlipayLifeMessageController.class.php b/service/Application/Admin/Controller/AlipayLifeMessageController.class.php index ed7195ce5..0162e585c 100644 --- a/service/Application/Admin/Controller/AlipayLifeMessageController.class.php +++ b/service/Application/Admin/Controller/AlipayLifeMessageController.class.php @@ -393,12 +393,39 @@ class AlipayLifeMessageController extends CommonController } // 删除 - if(M('AlipayLifeMessage')->delete(intval(I('id')))) + $id = intval(I('id')); + $m = M('AlipayLifeMessage'); + $m->startTrans(); + if($m->delete($id) && M('AlipayLifeMessageContent')->where(['alipay_life_message_id'=>$id])->delete()) + { + $m->commit(); + $this->ajaxReturn(L('common_operation_delete_success')); + } + $m->rollback(); + $this->ajaxReturn(L('common_operation_delete_error'), -100); + } + + /** + * [Delete 生活号消息内容删除] + * @author Devil + * @blog http://gong.gg/ + * @version 0.0.1 + * @datetime 2016-12-25T22:36:12+0800 + */ + public function ContentDelete() + { + // 是否ajax请求 + if(!IS_AJAX) + { + $this->error(L('common_unauthorized_access')); + } + + // 删除 + if(M('AlipayLifeMessageContent')->delete(intval(I('id')))) { $this->ajaxReturn(L('common_operation_delete_success')); - } else { - $this->ajaxReturn(L('common_operation_delete_error'), -100); } + $this->ajaxReturn(L('common_operation_delete_error'), -100); } /** diff --git a/service/Application/Admin/View/Default/AlipayLifeMessage/ContentSaveInfo.html b/service/Application/Admin/View/Default/AlipayLifeMessage/ContentSaveInfo.html index 1147886d4..4d6d63cd2 100644 --- a/service/Application/Admin/View/Default/AlipayLifeMessage/ContentSaveInfo.html +++ b/service/Application/Admin/View/Default/AlipayLifeMessage/ContentSaveInfo.html @@ -11,10 +11,12 @@ {{:L('common_operation_back')}} -
- - {{$data.title}}" required /> -
+ +
+ + {{$data.title}}" required /> +
+
diff --git a/service/Application/Runtime/Temp/8cde93cbd070139d84f31d26f8ea8f4d.php b/service/Application/Runtime/Temp/8cde93cbd070139d84f31d26f8ea8f4d.php index b6f7ecd91..3bf50e970 100644 --- a/service/Application/Runtime/Temp/8cde93cbd070139d84f31d26f8ea8f4d.php +++ b/service/Application/Runtime/Temp/8cde93cbd070139d84f31d26f8ea8f4d.php @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/service/Application/Runtime/Temp/a58f8070835be94249ea77f3601c6647.php b/service/Application/Runtime/Temp/a58f8070835be94249ea77f3601c6647.php index 754b0f684..57040510c 100644 --- a/service/Application/Runtime/Temp/a58f8070835be94249ea77f3601c6647.php +++ b/service/Application/Runtime/Temp/a58f8070835be94249ea77f3601c6647.php @@ -1,3 +1,3 @@ \ No newline at end of file diff --git a/service/Application/Service/AlipayLifeService.class.php b/service/Application/Service/AlipayLifeService.class.php index bdf6da61f..adfa5f8e4 100644 --- a/service/Application/Service/AlipayLifeService.class.php +++ b/service/Application/Service/AlipayLifeService.class.php @@ -237,11 +237,6 @@ class AlipayLifeService 'key_name' => 'message_id', 'error_msg' => '消息id有误', ], - [ - 'checked_type' => 'empty', - 'key_name' => 'title', - 'error_msg' => '消息标题有误', - ], [ 'checked_type' => 'empty', 'key_name' => 'content',