Пример #1
0
 public function actionRelistJobCompany()
 {
     //echo "<pre>";print_r($_REQUEST);die;
     $conver = new ConversationMsg();
     $conversation = new MsgDetails();
     $loggedId = Yii::app()->session['loggedId'];
     if (!empty($_REQUEST)) {
         $senderId = $_REQUEST['loggedId'];
         $reciverId = $_REQUEST['customer_id'];
         $booID = $_REQUEST['booking_id'];
         $conver->sender_id = $senderId;
         $conver->sender_type = 'company';
         $conver->reciver_id = $reciverId;
         $conver->booking_id = $booID;
         $conver->reciver_type = 'customer';
         $conver->sender_status = 1;
         $conver->subject = 'Please Review';
         $conver->save(false);
         $insert_idConver = Yii::app()->db->getLastInsertID();
         $conversation->conversation_id = $insert_idConver;
         $conversation->user_type = 'company';
         $conversation->user_id = $loggedId;
         $conversation->booking_id = $booID;
         $conversation->tomsg = $reciverId;
         $conversation->msg = $_REQUEST['MsgDetails']['msg'];
         $conversation->save(false);
         // chnage the job status in company request table
         $rec = ServiceReview::model()->find(array('condition' => 'booking_id=:booking_id', 'params' => array(':booking_id' => $booID)));
         if (!empty($rec)) {
             $rec->status = 0;
             $rec->save(false);
         }
         echo "success";
         die;
     }
 }
Пример #2
0
 public function actionAllDltConversation()
 {
     $id = $_REQUEST['id'];
     $detail = ConversationMsg::model()->with('msgDetails')->findByPk(array('id' => $id));
     //echo "<pre>";print_r($detail);die;
     foreach ($detail->msgDetails as $d) {
         if (!empty($d)) {
             $d->delete();
         }
     }
     //die;
     $detail->delete();
     echo "success";
     die;
 }