544782275@qq.com il y a 3 ans
Parent
commit
62479ebaf9
1 fichiers modifiés avec 9 ajouts et 0 suppressions
  1. 9 0
      application/store/controller/ConsultDetail.php

+ 9 - 0
application/store/controller/ConsultDetail.php

@@ -99,6 +99,15 @@ class ConsultDetail extends Controller
             );
             Db::name('store_consult')->where('id',$id)->update(array('is_answer'=>1,'from_user_id'=>session('user.engineer_id')));
             Db::name('store_consult')->insert($data);
+            //添加消息通知
+            $user_id = Db::name('store_consult')->where('id',$id)->value('user_id');
+            $new_data = array(
+                'user_id' => $user_id,
+                'content' => '您咨询的问题得到了新的回复,赶紧快来查看~',
+                'consult_id' => $root_consult_id,
+                'type' => 2
+            );
+            Db::name('store_news')->insert($new_data);
             $this->success('解答成功');
         } else {
             $this->_form($this->table, 'answer');