Esempio n. 1
0
 public function on_put()
 {
     if (I('post.action') == 'update_head') {
         $uid = I('post.uid') === "null" ? null : I('post.uid');
         if (false !== D('Crm/CrmClue', 'Service')->update_clue_head(I('post.clue_id'), $uid)) {
             $this->success(__('common.Operation Success'));
         }
         return;
     }
     parent::on_put();
 }
 public function on_post()
 {
     if (!I('get.is_push')) {
         return parent::on_post();
     }
     $_GET['id'] = I('get.opp_id');
     //        print_r(I('get.id'));exit;
     $rs = parent::on_put();
     if (false !== $rs && I('get.is_push')) {
         // 写客户沟通日志
         $stage = D('Home/CommonType')->where(array('id' => I('post.status')))->getField('name');
         $source = D('Marketing/SaleOpportunities')->find(I('get.id'));
         $content = sprintf(__('marketing.Push Opportunities To %s Stage'), '`' . $stage . '`');
         $content .= "\n\n";
         $content .= I('post.push_remark');
         $model = D('Crm/CustomerCommunicate');
         $model->add(array('content' => $content, 'created' => I('post.last_contact_time'), 'sale_opportunities_id' => I('get.id'), 'customer_id' => $source['customer_id'], 'company_id' => get_current_company_id(), 'user_id' => get_current_user_id()));
         //            echo $model->getLastSql();
     }
 }