当前位置: 首页>>代码示例>>PHP>>正文


PHP Carrier::model方法代码示例

本文整理汇总了PHP中Carrier::model方法的典型用法代码示例。如果您正苦于以下问题:PHP Carrier::model方法的具体用法?PHP Carrier::model怎么用?PHP Carrier::model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Carrier的用法示例。


在下文中一共展示了Carrier::model方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionSaveCall

 public function actionSaveCall()
 {
     $user = User::model()->find('id=:id', array(':id' => Yii::app()->user->id));
     $user_name = $user['first_name'] . ' ' . $user['last_name'];
     $id = $_POST['id'];
     $comment = $_POST['comment'];
     $post = Carrier::model()->findByPk($id);
     $post->Comment = $comment . '( ' . $user_name . ')';
     $post->Last_Activity_Date = date('Y-m-d');
     $post->save();
     $reports = new UserReports();
     $reports->client_id = (int) $id;
     $reports->user_id = (int) Yii::app()->user->id;
     $reports->action = 1;
     $reports->comment = $comment;
     $reports->date = date('Y-m-d');
     $reports->save();
     $model = new Carrier('search');
     $model->unsetAttributes();
     // clear any default values
     if (isset($_GET['Carrier'])) {
         $model->attributes = $_GET['Carrier'];
     }
     $this->render('admin', array('model' => $model));
 }
开发者ID:VitaliyMinenko,项目名称:CRM,代码行数:25,代码来源:CarrierController.php

示例2: actionChngShiping

 public function actionChngShiping()
 {
     $id = $_GET['id'];
     $carrier_name = $_GET['carrier_name'];
     $carrier_id = $_GET['carrier_id'];
     $route = $_GET['route'];
     $Shipping = new Shipping();
     $items = $Shipping->GetShipping($id);
     $item = $items[0];
     if (!empty($item['carriers_id'])) {
         $carriers_id_arr = explode(', ', $item['carriers_id']);
         array_push($carriers_id_arr, $carrier_id);
         $result = array_unique($carriers_id_arr);
         $final_carriers_id = implode(', ', $result);
     } else {
         $final_carriers_id = $carrier_id;
     }
     if (!empty($item['carrier_name'])) {
         $carriers_name_arr = explode('|', $item['carrier_name']);
         array_push($carriers_name_arr, $carrier_name);
         $res = array_unique($carriers_name_arr);
         $final_carriers_name = implode('|', $res);
     } else {
         $final_carriers_name = $carrier_name;
     }
     $post = Shipping::model()->findByPk($id);
     $post->carriers_id = $final_carriers_id;
     $post->carrier_name = $final_carriers_name;
     $post->save();
     if ($post->save()) {
         $car = $Shipping->getCarrier($carrier_id);
         $carrier = $car[0];
         if (!empty($carrier['Direction'])) {
             $carriers_Direction_arr = explode(' | ', $carrier['Direction']);
             array_push($carriers_Direction_arr, $route);
             $carr = array_unique($carriers_Direction_arr);
             $final_route = implode(' | ', $carr);
         } else {
             $final_route = $route;
         }
         if (!empty($carrier['Direction_id'])) {
             $carriers_Direction_id_arr = explode(', ', $carrier['Direction_id']);
             array_push($carriers_Direction_id_arr, $id);
             $carrid = array_unique($carriers_Direction_id_arr);
             $final_id = implode(', ', $carrid);
         } else {
             $final_id = $id;
         }
         $Carrier = Carrier::model()->findByPk($carrier_id);
         $Carrier->Direction = $final_route;
         $Carrier->Direction_id = $final_id;
         $Carrier->save();
         // var_dump($Carrier->errors);die;
         $this->redirect(array('view', 'id' => $post->id));
     }
 }
开发者ID:VitaliyMinenko,项目名称:CRM,代码行数:56,代码来源:ShippingController.php


注:本文中的Carrier::model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。