示例#1
0
 public function actionGetlogisticslist()
 {
     $organID = Commonmodel::getOrganID();
     //获取机构ID
     $criteria = new CDbCriteria();
     $criteria->select = "*";
     $criteria->order = "id DESC";
     $criteria->addCondition("OrganID=" . $organID);
     //查询条件:根据机构ID查询物流数据
     $count = Logistics::model()->count($criteria);
     $pages = new CPagination($count);
     $pages->applyLimit($criteria);
     $modeles = Logistics::model()->findAll($criteria);
     foreach ($modeles as $key => $value) {
         $data[$key]['ID'] = $value['ID'];
         $data[$key]['OrganID'] = $value['OrganID'];
         $data[$key]['Company'] = F::msubstr($value['LogisticsCompany']);
         $data[$key]['Description'] = F::msubstr($value['LogisticsDescription']);
         $data[$key]['LogisticsCompany'] = $value['LogisticsCompany'];
         $data[$key]['LogisticsDescription'] = $value['LogisticsDescription'];
         $data[$key]['CreateTime'] = date("Y-m-d H:i:s", $value['CreateTime']);
         $data[$key]['UpdateTime'] = $value['UpdateTime'];
         $data[$key]['Status'] = $value['Status'];
         $address = $this->getAddress($value['ID']);
         $data[$key]['Address'] = $address ? F::msubstr(substr($address, 0, -3)) : '';
         $data[$key]['AddressDetail'] = $address ? substr($address, 0, -3) : '';
         //$data[$key]['Address'] = Area::getCity($address['Province']) . Area::getCity($address['City']) . Area::getCity($address['Area']);
     }
     $rs = array('total' => $count, 'rows' => $data ? $data : array());
     //        var_dump($rs);exit;
     echo json_encode($rs);
 }
示例#2
0
 public function actionQuotelist()
 {
     $userID = Commonmodel::getOrganID();
     $criteria = new CDbCriteria();
     if ($_GET) {
         if ($_GET['num']) {
             $criteria->addSearchCondition('ItemNum', "{$_GET['num']}", "AND");
         }
         if ($_GET['name']) {
             $criteria->addSearchCondition('ItemName', "{$_GET['name']}", "AND");
         }
     }
     $criteria->order = "t.UpdateTime DESC,t.ID DESC";
     //排序条件:t.UpdateTime,t.ID倒叙
     $criteria->addCondition("t.OrganID = {$userID}");
     $criteria->addCondition("t.Status = 0");
     $count = ServiceItems::model()->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = $_GET['rows'];
     $pages->applyLimit($criteria);
     $model = ServiceItems::model()->findAll($criteria);
     foreach ($model as $key => $value) {
         $data[$key] = $value->attributes;
         $data[$key]['ItemNums'] = F::msubstr($value['ItemNum']);
         $data[$key]['ItemNames'] = F::msubstr($value['ItemName']);
         $data[$key]['ItemExplan'] = F::msubstr($value['ItemIntro']);
     }
     $rs = array('total' => $count, 'rows' => $data ? $data : array());
     echo json_encode($rs);
 }
示例#3
0
 public function actionMaintainlist()
 {
     $userID = Commonmodel::getOrganID();
     $criteria = new CDbCriteria();
     $criteria->with = "owners";
     if ($_GET) {
         if ($_GET['name']) {
             $remind = $this->getRecord($_GET['name']);
             $criteria->addInCondition('t.ID', $remind);
         }
         if ($_GET['status']) {
             $criteria->addCondition("t.Status = {$_GET['status']}", "AND");
         }
         if ($_GET['date']) {
             $starttime = strtotime($_GET['date']);
             $endtime = (int) (strtotime($_GET['date']) + 60 * 60 * 24);
             $criteria->addBetweenCondition('t.MaintainDate', $starttime, $endtime, "AND");
         }
     }
     $criteria->order = "t.MaintainDate DESC,t.UpdateTime DESC";
     //排序条件:t.MaintainDate,t.UpdateTime倒叙
     $criteria->addCondition("t.OrganID = {$userID}", "AND");
     $count = MaintainRemind::model()->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = $_GET['rows'];
     $pages->applyLimit($criteria);
     $model = MaintainRemind::model()->findAll($criteria);
     foreach ($model as $key => $value) {
         $data[$key]['ID'] = $value['ID'];
         if ($value['Status'] == '1') {
             $data[$key]['State'] = '待发送';
         } elseif ($value['Status'] == '2') {
             $data[$key]['State'] = '已发送';
         } else {
             $data[$key]['State'] = '取消发送';
         }
         $data[$key]['Status'] = $value['Status'];
         $data[$key]['MaintainDate'] = date('Y-m-d', $value['MaintainDate']);
         $data[$key]['MaintainTime'] = $value['MaintainDate'];
         $data[$key]['RemindContent'] = $value['RemindContent'];
         $data[$key]['Content'] = F::msubstr($value['RemindContent']);
         foreach ($value->owners as $owners_key => $owners_value) {
             $data[$key]['OldName'] .= $owners_value->Name . ",";
             $data[$key]['Name'] = F::msubstr(substr($data[$key]['OldName'], 0, -1));
         }
     }
     $rs = array('total' => $count, 'rows' => $data ? $data : array());
     echo json_encode($rs);
 }
示例#4
0
文件: Item.php 项目: lhfcainiao/basic
 /**
  * get item title
  * @return string
  */
 public function getTitle()
 {
     return CHtml::link(F::msubstr($this->title, '0', '15', 'utf-8'), array('/item/view', 'id' => $this->item_id), array('title' => $this->title));
 }
示例#5
0
文件: contacts.php 项目: zwq/unpei
                                <td>
                                    <?php 
        echo F::msubstr($model->organName);
        ?>
                                </td>
                                <td >
                                    <?php 
        echo F::msubstr($model->contactsName . ' ' . $model->telephone);
        ?>
                                </td>
                                <td ><?php 
        echo $model->cooperateType;
        ?>
</td>
                                <td ><?php 
        echo F::msubstr($model->remarks);
        ?>
</td>
                                <td ><?php 
        echo $model->customerType;
        ?>
</td>
                                <td >
                                    <?php 
        echo CHtml::link('修改', 'javascript:void(0)', array('id' => 'modify', 'modelid' => $model->id));
        ?>
||<?php 
        echo CHtml::link('删除', 'javascript:void(0)', array('id' => 'delete', 'modelid' => $model->id, 'key' => 'cont'));
        ?>
                                </td>
                            </tr>
示例#6
0
 public function actionContact()
 {
     $OrganID = Commonmodel::getOrganID();
     //获取共享关系表中机构ID
     $ids = $this->getShareids();
     //获取用户表中所有经销商ID
     $users = User::getDealerID();
     foreach ($users as $user) {
         $identity[] = $user['id'];
     }
     //获取不在共享关系表中的机构信息
     $criteria = new CDbCriteria();
     $criteria->addInCondition('t.contact_user_id', $identity);
     //业务联系人属于经销商
     $criteria->addCondition("t.user_id = {$OrganID}", "AND");
     //当前机构下
     $criteria->addCondition("t.Status = 0", "AND");
     //未删除
     $criteria->addNotInCondition('t.contact_user_id', $ids);
     //业务联系人不在确定共享关系中
     $criteria->order = "t.create_time desc";
     //以添加时间倒序
     //通过机构名称模糊检索
     if ($_GET['name']) {
         $criteria->addSearchCondition('t.companyname', $_GET['name'], "AND");
     }
     //分页
     $count = BusinessContacts::model()->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = $_GET['rows'];
     $pages->applyLimit($criteria);
     $model = BusinessContacts::model()->findAll($criteria);
     foreach ($model as $key => $value) {
         $data[$key]['id'] = $value['id'];
         $data[$key]['name'] = F::msubstr($value['name']);
         $data[$key]['sex'] = $value['sex'];
         $data[$key]['jiapart_ID'] = $value['jiapart_ID'];
         $data[$key]['companyname'] = F::msubstr($value['companyname']);
         $data[$key]['phone'] = F::msubstr($value['phone']);
         $data[$key]['address'] = F::msubstr(Area::getCity($value['province']) . Area::getCity($value['city']) . Area::getCity($value['area']));
     }
     $rs = array('total' => $count, 'rows' => $data ? $data : array());
     echo json_encode($rs);
 }
示例#7
0
文件: promotions.php 项目: zwq/unpei
        echo F::msubstr($cp);
        $cp = '';
        ?>
                                        </td>
                                        <td><?php 
        $dealerv = DealerVehicle::model()->findAll('userid =' . $model['userID']);
        foreach ($dealerv as $transports) {
            $cars .= GoodsBrand::getName($transports['businessCar']) . ' ' . GoodsBrand::getCar($transports['businessCarModel']) . ',';
        }
        echo F::msubstr($cars, 0, 0);
        $cars = '';
        ?>
                                        </td>
                                        <td>
                                            <?php 
        echo !empty($model['BusinessBrand']) ? F::msubstr($model['BusinessBrand'], 0, 0) : "暂无";
        ?>
                                        </td>
                                        <td>
                                            <?php 
        if (!empty($model['userID'])) {
            ?>
                                                <a target="_blank" href='<?php 
            echo Yii::app()->createUrl('servicer/servicequery/QueryProGoods/userID');
            echo '/' . $model['userID'];
            ?>
'>查看商品</a>
                                            <?php 
        } else {
            ?>
                                                暂无
示例#8
0
文件: shouqgoods.php 项目: zwq/unpei
</td>
									<td><?php 
        echo $product['goodsprice'];
        ?>
</td>
									<td><?php 
        echo $product['parts_level'];
        ?>
</td>
									<td>
											<?php 
        echo $product['OE'];
        ?>
									</td>
									<td><?php 
        echo F::msubstr($product['description'], 0, 0);
        //$product['youhui']
        ?>
</td>
								</tr>
								<?php 
        $i++;
        ?>
								<?php 
    }
    ?>
                                                                 </tbody>
                                                               </table>
								<?php 
} else {
    ?>
示例#9
0
文件: salesinfo.php 项目: zwq/unpei
</td>
				<td >
					<?php 
        echo $goods['parts_level'];
        ?>
					
				</td>
				<td >
					<?php 
        echo $goods['senddays'];
        ?>
					
				</td>
				<td >
					<?php 
        echo F::msubstr($goods['description']);
        ?>
					
				</td>
				<td >
					<a class='y-align-m' href="<?php 
        echo Yii::app()->createUrl('maker/salesmanage/modify', array('id' => $goods['goodsID']));
        ?>
"><i class='icon-pencil-green display-ib'></i></a>
					<span class='y-align-m' ><i class='icon-red-cross display-ib' crowid="<?php 
        echo $goods['goodsID'];
        ?>
" style="cursor:pointer"></i></span>
				</td>
			</tr>
			<?php 
示例#10
0
文件: service.php 项目: zwq/unpei
        ?>
</td>
									<td ><?php 
        echo $ser['serviceParkingDigits'];
        ?>
</td>
									<td ><?php 
        echo $ser['serviceTechnicianCount'];
        ?>
</td>
									<td ><?php 
        echo F::msubstr($insurance[$i]['insuranceService']);
        ?>
</td>
									<td ><?php 
        echo F::msubstr(Area::getCity($ser['serviceProvince']) . Area::getCity($ser['serviceCity']) . Area::getCity($ser['serviceArea']) . $ser['serviceAddress'], 0, 0);
        ?>
</td>
								</tr>
								<?php 
        $i++;
        $j++;
    }
    ?>
							</tbody>
						</table>
					</div>
					<div id="ctable3">3</div>
					<div id="ctable4"></div>
				</div>
			</div>		
示例#11
0
文件: paramsinfo.php 项目: zwq/unpei
				<?php 
        echo F::msubstr($goods['Column4']);
        ?>
				<?php 
        if (isset($goods['value4']) && !empty($goods['value4'])) {
            ?>
				<?php 
            echo ":&nbsp;" . $goods['value4'];
            ?>
				<?php 
        }
        ?>
			</td>
			<td >
				<?php 
        echo F::msubstr($goods['Column5']);
        ?>
				<?php 
        if (isset($goods['value5']) && !empty($goods['value5'])) {
            ?>
				<?php 
            echo ":&nbsp;" . $goods['value5'];
            ?>
				<?php 
        }
        ?>
			</td>
			<td >
				<a class='y-align-m' href="<?php 
        echo Yii::app()->createUrl('maker/salesmanage/modify', array('id' => $goods['goodsID']));
        ?>
示例#12
0
						</td>
						<td ><?php 
        echo $goods['brand'];
        ?>
</td>
						<td ><?php 
        echo $goods['cp_name'];
        ?>
</td>
						<td ><?php 
        echo $goods['category'];
        ?>
</td>
						<td >
							<?php 
        echo F::msubstr($goods['oe']);
        ?>
						</td>
						<input type="hidden" value="<?php 
        echo $goods['goodsID'];
        ?>
" name="goodscatesrelation[]">
					</tr>
					<?php 
    }
    ?>
					<?php 
}
?>
				</tbody>
			</table>
示例#13
0
 /**
  * 品类列表
  */
 public function actionCatelist()
 {
     $user_id = Commonmodel::getOrganID();
     $criteria = new CDbCriteria();
     $criteria->select = "*";
     $criteria->condition = 'userID=' . $user_id;
     $criteria->order = 'id DESC';
     $count = MakeEmpowerCategory::model()->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = $_GET['rows'];
     $pages->applyLimit($criteria);
     $models = MakeEmpowerCategory::model()->findAll($criteria);
     foreach ($models as $key => $val) {
         $cate[$key]['id'] = $val->id;
         $cate[$key]['cateName'] = F::msubstr($val->cateName);
         $cate[$key]['remarks'] = F::msubstr($val->remarks);
     }
     $userInfo['total'] = $count;
     $userInfo['rows'] = $cate ? $cate : array();
     // $record;
     echo json_encode($userInfo);
 }
示例#14
0
        } else {
            echo "无";
        }
        ?>
</td>
                                <td><?php 
        if ($model['QQ']) {
            echo $model['QQ'];
        } else {
            echo "无";
        }
        ?>
</td>
                                <td><?php 
        if ($model['memo']) {
            echo F::msubstr($model['memo']);
        } else {
            echo "无";
        }
        ?>
</td>
                                <td><?php 
        if ($model['customercategory']) {
            echo $model['customercategory'];
        } else {
            echo "无";
        }
        ?>
</td>
                                <td><?php 
        echo CHtml::link('修改', array("marketing/processcontact/id/{$model['id']}"), array('confirm' => '您确定要修改吗?'));
示例#15
0
文件: DealerGoods.php 项目: zwq/unpei
 public static function getGoodsList($params = '')
 {
     $organ_ID = Commonmodel::getOrganID();
     // 查询条件
     if (is_array($params)) {
         $organID = $params['OrganID'];
         // 机构ID
         $rows = $params['rows'];
         $curpage = $params['page'];
         // 每页显示条数
         //            $goodsNO = $params['goodsNO'];              // 商品编号
         $goodsName = trim($params['goodsName']);
         // 商品名称
         //            $pinyin = $params['pinyin'];          // 商品名称
         //            $brandID = $params['BrandID'];              // 商品品牌ID
         //            $brand = $params['BrandName'];              // 商品品牌名
         //            $OENO = $params['OENO'];                    // 商品OE号
         //            $IsSale = $params['IsSale'];                // 是否上架
         $IsPro = $params['IsPro'];
         // 是否促销
         //            $gbigparts = $params['gbigparts'];          // 大类
         //            $gsubparts = $params['gsubparts'];          // 子类
         $gcpname = $params['gcpname'];
         // 标准名称
         $gmake = $params['gmake'];
         // 厂家
         $gcar = $params['gcar'];
         // 车系
         $gyear = $params['gyear'];
         // 年款
         $gmodel = $params['gmodel'];
         // 车型
         $orderby = $params['orderby'];
         // 排序
         if ($orderby == 'pirec_big' || $orderby == 'pirec_small') {
             //总价从高到低
             $sql = "SELECT dg.*,if(dg.ProPrice,dg.ProPrice,if(discount.PriceRatio,discount.PriceRatio*dg.Price,dg.Price)) as ppp FROM tbl_dealer_goods dg left join(\n                SELECT p.OrganID as OrganID, left(p.PriceRatio,char_length(p.PriceRatio)-1)/100 as PriceRatio from  tbl_price_manage AS p ,tbl_business_contacts as bc WHERE \n                p.CooperationType = bc.cooperationtype \n                AND  bc.contact_user_id = {$organ_ID} and bc.user_id=p.OrganID and bc.Status=0\n                AND (!ISNULL(p.PriceRatio) AND p.PriceRatio !='')) as discount \n                on dg.OrganID = discount.OrganID where dg.ISdelete=1 ";
         } else {
             $sql = "SELECT dg.* FROM tbl_dealer_goods as dg where dg.ISdelete=1 ";
         }
         //商品编号、oe号
         if ($goodsName) {
             $sql .= " and (dg.Title like '%{$goodsName}%') ";
         }
         // 机构名称
         if (!empty($organID)) {
             $sql .= " and dg.OrganID = {$organID}";
         }
         //标准名称
         if ($gcpname) {
             $sql .= " and dg.CpNameTxt = '{$gcpname}'";
         }
         // 是否促销
         if (empty($IsPro) || $IsPro == 'all') {
             $sql .= " and dg.IsPro between 0 and 1";
         } else {
             if ($IsPro == 2) {
                 // 不是促销的
                 $sql .= " and dg.IsPro = 0";
             } else {
                 // 是促销的
                 $sql .= " and dg.IsPro = 1";
             }
         }
         // 车型车系
         if (!empty($gmake)) {
             $arr = array();
             $arr['gmake'] = $gmake ? $gmake : 0;
             $arr['gcar'] = $gcar ? $gcar : 0;
             $arr['gyear'] = $gyear ? $gyear : 0;
             $arr['gmodel'] = $gmodel ? $gmodel : 0;
             $goodsIDS = self::getVehcondition($arr);
             if ($goodsIDS) {
                 $goodsStr = implode(',', $goodsIDS);
                 $sql .= " and dg.ID in ({$goodsStr})";
             } else {
                 $sql .= " and dg.ID in (0)";
             }
         }
         if ($orderby) {
             if ($orderby == 'sales') {
                 // 按销量排序
                 $sql .= " order by dg.Sales DESC";
             } elseif ($orderby == 'xinyong') {
                 // 信用排序
                 $sql .= " order by dg.Name DESC";
             } elseif ($orderby == 'pirec_big') {
                 //总价从高到低
                 //if ($IsPro) {
                 $sql .= " order by ppp DESC";
                 //                    } else {
                 //                        $sql.=" order by discount.PriceRatio*dg.Price DESC";
                 //                    }
             } elseif ($orderby == 'pirec_small') {
                 // 总价从低到高
                 //if ($IsPro) {
                 $sql .= " order by ppp ASC";
                 //                    } else {
                 //                        $sql.=" order by discount.PriceRatio*dg.Price ASC";
                 //                    }
             }
         }
     } else {
         if (!empty($params) && !is_array($params)) {
             return '参数传入错误';
         }
     }
     //echo $sql;exit;
     $count = count(DBUtil::queryAll($sql));
     $pages = new CPagination($count);
     $pages->pageSize = $rows == '' ? 12 : $rows;
     $offset = ($curpage - 1) * $pages->pageSize;
     $goodses = DBUtil::queryAll($sql . " LIMIT {$offset},{$pages->pageSize}");
     $data = array();
     foreach ($goodses as $key => $goods) {
         $price = self::getContactprice($goods['OrganID'], $params['serviceID']);
         $data[$key]['PriceRatio'] = $price['PriceRatio'] ? $price['PriceRatio'] : "100%";
         $data[$key]['ImageUrl'] = self::getNewImage($goods['ID'], $goods['OrganID']);
         $data[$key]['ID'] = $goods['ID'];
         $data[$key]['OrganID'] = $goods['OrganID'];
         $organInfo = self::getOrganName($goods['OrganID']);
         $data[$key]['OrganName'] = $organInfo['organName'];
         $data[$key]['Name'] = $goods['Name'];
         $data[$key]['goodsName'] = F::msubstr($goods['Name'], 0, 20);
         $data[$key]['gName'] = mb_substr($goods['Name'], 0, 30, 'utf-8');
         $data[$key]['Pinyin'] = $goods['Pinyin'];
         $data[$key]['Brand'] = $goods['Brand'];
         $data[$key]['goodsBrand'] = $goods['BrandID'];
         $data[$key]['GoodsNO'] = $goods['GoodsNO'];
         $data[$key]['OENO'] = $goods['OENO'];
         $data[$key]['Sales'] = $goods['Sales'];
         $data[$key]['OENOS'] = self::getOENOSByGoodsID($goods['ID']);
         $memolen = strlen($goods['Memo']);
         if ($memolen >= 60) {
             $data[$key]['Memo'] = $goods['Memo'] ? mb_substr($goods['Memo'], 0, 26, 'utf-8') . '…' : '';
         } else {
             $data[$key]['Memo'] = $goods['Memo'] ? $goods['Memo'] : '';
         }
         // 车型车系
         $vehs = explode('、', self::getVehicleByGoodsID($goods['ID']));
         //  'seriesName'=>'','makeId'=>'','makeName'=>'');
         //检索商品本身的适用车型,如果有子集的车型则显示有子集的车型
         $currv = self::getCurrentVehicle($arr, $goods['ID']);
         $data[$key]['Vehicle'] = self::getCurrentVehicle($arr, $goods['ID']);
         $data[$key]['Vehicle'] = $currv ? $currv : $vehs[0];
         $data[$key]['Vehicles'] = self::getVehicleByGoodsID($goods['ID']);
         $data[$key]['ListPrice'] = $goods['Price'];
         //参考价
         $data[$key]['Price'] = sprintf("%.2f", $goods['Price'] * $data[$key]['PriceRatio'] / 100);
         // 折扣价,小数点后面保留两位
         if ($goods['IsPro'] == 1) {
             if (!is_null($goods['ProPrice']) && $goods['ProPrice']) {
                 $data[$key]['ProPrice'] = $data[$key]['ProPrice'];
             }
             //                if (empty($goods['ProPrice']) || $goods['ProPrice'] == 0) {
             //                    $data[$key]['ProPrice'] = $data[$key]['Price'];
             //                    $data[$key]['Price'] = $data[$key]['Price'];
             //                    // 促销价
             //                } else {
             //                    $data[$key]['ProPrice'] = $goods['ProPrice'];           // 促销价
             //                    $data[$key]['Price'] = $goods['ProPrice'];
             //                }
         }
         $data[$key]['LogisticsPrice'] = $goods['LogisticsPrice'];
         // 物流价
         $data[$key]['CpName'] = $goods['CpNameTxt'];
         // 用于排序
         //            $listP[$key] = $data[$key]['Price']; // 参考价
         //            $disP[$key] = $data[$key]['Price'];    // 折扣价
         //            $logiP[$key] = $data[$key]['LogisticsPrice'];    // 物流价
         //            $proP[$key] = $data[$key]['ProPrice'];    // 物流价
         // $data[$key]['CpName'] = Commonmodel::getCategory($goods['CpName']);
         // $data[$key]['sutecar'] = F::msubstr($this->getcar($goods['ID']));
         // 商品属性
     }
     //        if ($orderby == 'pirec_big') {   //总价从高到低
     //            array_multisort($disP, SORT_DESC, $listP, SORT_DESC, $data, SORT_DESC);    // ,$proP,SORT_DESC
     //        } elseif ($orderby == 'pirec_small') { // 总价从低到高
     //            array_multisort($disP, SORT_ASC, $listP, SORT_ASC, $data, SORT_ASC);    // ,$proP,SORT_DESC
     //        }
     $data[0]['count'] = $count;
     //        var_dump($data);
     return $data;
 }
示例#16
0
文件: empgoods.php 项目: zwq/unpei
									<td ><?php 
        echo $product['parts_level'];
        ?>
</td>
									<td ><?php 
        echo '¥' . $product['goodsprice'];
        ?>
</td>
									<td >
										<?php 
        echo F::msubstr($product['OENO']);
        ?>
									</td>
									<td >
										<?php 
        echo F::msubstr($product['car']);
        ?>
									</td>
								</tr>
								<?php 
        $i++;
        ?>
								<?php 
    }
    ?>
							</tbody>
						</table>
						<?php 
} else {
    ?>
							<center><p>搜索到&nbsp;<font color=red>0</font>&nbsp;条数据 &nbsp;&nbsp;<span style="text-decoration: underline"><?php 
示例#17
0
</td>
				<td name='companyname'><?php 
        echo $dealer['organName'];
        ?>
</td>
				<td name='phone'><?php 
        echo $dealer['Phone'];
        ?>
</td>
				<td name='email'><?php 
        echo $dealer['Email'];
        ?>
</td>
				<td><?php 
        $address = Area::getCity($dealer->province) . Area::getCity($dealer->city) . Area::getCity($dealer->area) . $dealer->address;
        echo F::msubstr($address);
        ?>
</td>
				<td><?php 
        echo CHtml::button('选择', array('class' => 'btn-small', 'id' => 'opt'));
        ?>
</td>
			</tr>
		<?php 
        $i++;
    }
    ?>
	</tbody>
	<?php 
} else {
    ?>
示例#18
0
	<tbody>
	<?php 
    foreach ($result as $goods) {
        ?>
		<tr class='bd-tb'>
			<td>
				<input type='checkbox' />
			</td>
			<td><?php 
        echo F::msubstr($goods['goodsno']);
        ?>
</td>
			<td>
				<div class='pos-r'>
					<?php 
        echo F::msubstr($goods['goodsname']);
        ?>
					<i class='icon-new pos-a'></i>
				</div>
			</td>
			<td ><?php 
        echo $goods['brand'];
        ?>
</td>
			<td ></td>
			<td ></td>
			<td ></td>
		</tr>
		<?php 
    }
    ?>
示例#19
0
        //
        ?>
									</td>
									<td >
										<?php 
        $vehicles = DealerParts::model()->findAll('pgoods_id=:pgoods_id', array('pgoods_id' => $product['id']));
        foreach ($vehicles as $vehicle) {
            $veh .= GoodsBrand::getName($vehicle['maincate']) . GoodsBrand::getCar($vehicle['subcate']) . '-';
        }
        echo F::msubstr($veh);
        $veh = '';
        ?>
									</td>
									
									<td><?php 
        echo F::msubstr($product['youhui'], 0, 8);
        //$product['youhui']
        ?>
</td>
								</tr>
								<?php 
        $i++;
        ?>
								<?php 
    }
    ?>
							</tbody>
							<?php 
} else {
    ?>
								<tr>
示例#20
0
 public function actionSharecontact()
 {
     $organID = Commonmodel::getOrganID();
     $dealer = Dealer::model()->find('userID=:userid', array(':userid' => $organID));
     $share = BusinessShare::model()->findAll('InitiatorID=:intorID and Status=2', array(':intorID' => $organID));
     foreach ($share as $key => $value) {
         $shareID .= ',' . $value['ShareID'];
     }
     $shareID = ltrim($shareID, ",");
     //查出shareID
     $sql = "select a.id,a.contact_user_id,a.customertype,\n\t\t   a.cooperationtype,a.name,a.sex,\n\t\t   a.companyname,a.phone,a.province,a.city,a.area,a.email,\n\t\t   a.weixin,a.QQ,a.create_time,a.Status,a.jiapart_ID,a.update_time,\n\t\t   (select b.category from tbl_customer_category b where a.customercategory=b.id and a.user_id={$organID}) as customercategory\n\t\t   from tbl_business_contacts a where \n\t\t   user_id='{$organID}' and Status=0  and a.contact_user_id in({$shareID})";
     if ($_POST) {
         $search['name'] = $_POST['name'];
         $search['phone'] = $_POST['phone'];
         $search['keyword'] = $_POST['keyword'];
         if ($search) {
             if ($search['name']) {
                 $sql .= " and name like'%{$search['name']}%'";
             }
             if ($search['phone']) {
                 $sql .= " and phone like '%{$search['phone']}%'";
             }
             if ($search['keyword']) {
                 $sql .= " and (companyname like '%{$search['keyword']}%') ";
             }
         }
     }
     $sql .= "order by create_time desc";
     $criteria = new CDbCriteria();
     $models = Yii::app()->db->createCommand($sql)->queryAll();
     $count = count($models);
     $pages = new CPagination($count);
     $pages->pageSize = intval($_GET['rows']);
     $pages->applylimit($criteria);
     $models = Yii::app()->db->createCommand($sql . " LIMIT :offset,:limit");
     $models->bindValue(':offset', $pages->currentPage * $pages->pageSize);
     $models->bindValue(':limit', $pages->pageSize);
     $models = $models->queryAll();
     foreach ($models as $key => $value) {
         $data[$key]['id'] = $value['id'];
         $data[$key]['Initiator'] = F::msubstr($dealer['organName']);
         $data[$key]['companyID'] = $value['contact_user_id'];
         //$data[$key]['customertype'] = $value['customertype'];
         $data[$key]['cooperationtype'] = $value['cooperationtype'];
         $data[$key]['customercategory'] = $value['customercategory'];
         $data[$key]['name'] = $value['name'];
         $data[$key]['sex'] = $value['sex'];
         $data[$key]['companyname2'] = F::msubstr($value['companyname']);
         $data[$key]['companyname'] = $value['companyname'];
         $data[$key]['phone'] = $value['phone'];
         $data[$key]['province'] = $value['province'];
         $data[$key]['city'] = $value['city'];
         $data[$key]['area'] = $value['area'];
         $data[$key]['address'] = F::msubstr(Area::getCity($value['province']) . Area::getCity($value['city']) . Area::getCity($value['area']));
         $data[$key]['email'] = $value['email'];
         $data[$key]['weixin'] = $value['weixin'];
         $data[$key]['QQ'] = $value['QQ'];
         $data[$key]['create_time'] = $value['create_time'];
         $data[$key]['Status'] = $value['Status'];
         $data[$key]['jiapart_ID'] = $value['jiapart_ID'];
         $data[$key]['update_time'] = $value['update_time'];
         //$data[$key]['checked']=true;
     }
     $rs = array('total' => $count, 'rows' => !empty($data) ? $data : array());
     echo json_encode($rs);
 }
示例#21
0
文件: goodsinfo.php 项目: zwq/unpei
?>
"><?php 
echo DealergoodsService::standCodegetcpname($data['StandCode'], 'Name');
?>
</a></div>
                    <div class="float_l color_hui">|</div>
                    <div class="float_l cut m_left" style="width:130px;white-space: nowrap;overflow: hidden; text-overflow: ellipsis;">拼音代码:<a title="<?php 
echo $data['Pinyin'];
?>
"><?php 
echo $data['Pinyin'];
?>
</a></div> 
                </div>
                <p class="m-top5" style=" width: 270px;height: 16px;white-space: nowrap;overflow: hidden; text-overflow: ellipsis;">备注:<span><?php 
echo F::msubstr($data['Memo']);
?>
</span></p>
            </div>
            <div class="float_l zwq_price" style="width:200px;"><p class="m-top">促销价:<span class="zwq_color">¥<?php 
echo $data['ProPrice'];
?>
</span></p><p class="cankaojia">参考价:<span class="zwq_color">¥<?php 
echo $data['Price'];
?>
</span></p><p>促销时间:<span><?php 
echo date("Y-m-d", $data['ProTime']) . '--' . date("Y-m-d", $data['ProTime'] + 60 * 60 * 24 * 14);
?>
</span></p></div>
            <div class="float_l zwq_OE m_left" style="width:130px;">
                <div class="zwq_top" style="margin-top:18px;"><img src="<?php 
示例#22
0
 public function actionCheckcar()
 {
     $organID = Commonmodel::getOrganID();
     $criteria = new CDbCriteria();
     $criteria->with = "owner";
     $criteria->addCondition("t.OrganID = {$organID}");
     $criteria->addSearchCondition('t.LicensePlate', "{$_POST['licenseplate']}", "AND");
     $model = CarInfo::model()->findAll($criteria);
     foreach ($model as $key => $value) {
         //车辆ID
         $data[$key]['ID'] = $value['ID'];
         //车主信息
         $data[$key]['Name'] = $value->owner->Name ? F::msubstr($value->owner->Name) : '未绑定';
         $data[$key]['Phone'] = $value->owner->Phone ? F::msubstr($value->owner->Phone) : '未绑定';
         $data[$key]['City'] = $value->owner->City ? F::msubstr(str_replace("/", "", $value->owner->City)) : '未绑定';
         //车辆信息
         $data[$key]['LicensePlate'] = F::msubstr($value['LicensePlate']);
         if ($value['UseNature'] == '1') {
             $data[$key]['Uses'] = "私家车";
         } elseif ($value['UseNature'] == '2') {
             $data[$key]['Uses'] = "公务车";
         } else {
             $data[$key]['Uses'] = "运营车辆";
         }
         $data[$key]['Car'] = F::msubstr(str_replace(",", "", $value['Car']));
         $data[$key]['VinCode'] = $value['VinCode'];
         $data[$key]['Miles'] = $value['Mileage'];
         $data[$key]['BuyTime'] = date('Y-m-d', $value['BuyTime']);
     }
     $rs = array('totals' => count($model), 'rows' => $data ? $data : array());
     echo json_encode($rs);
 }
示例#23
0
 public function actionOrderexport()
 {
     $model = PapOrder::model()->findByPk($_GET['ID']);
     //订单信息
     $data['SellerID'] = $model->SellerID;
     $data['BuyerID'] = $model->BuyerID;
     $data['CreateTime'] = date("Y-m-d H:i:s", $model->CreateTime);
     $data['OrderSN'] = $model->OrderSN;
     $data['SellerName'] = $model->SellerName;
     $data['BuyerName'] = $model->BuyerName;
     $data['GoodsList'] = "商品清单";
     $data['TotalAmount'] = "¥" . $model->TotalAmount;
     $data['ShipSn'] = $model->ShipSn;
     $data['ShipLogis'] = $model->ShipLogis;
     $data['ReShipSn'] = $model->ReShipSn;
     $data['ReShipLogis'] = $model->ReShipLogis;
     $data['ListShip'] = $model->ShipCost;
     $data['PayTime'] = $model->PayTime ? date("Y-m-d H:i:s", $model->PayTime) : '';
     $data['DeliveryTime'] = $model->DeliveryTime ? date("Y-m-d H:i:s", $model->DeliveryTime) : '';
     $data['ReceiptTime'] = $model->ReceiptTime ? date("Y-m-d H:i:s", $model->ReceiptTime) : '';
     if ($model->Payment == '1') {
         $data['Payment'] = "支付宝担保交易";
     } elseif ($model->Payment == '2') {
         $data['Payment'] = "物流代收款";
     }
     $data['Status'] = $model->Status;
     $data['IsUnusual'] = $model->IsUnusual;
     //获取收货地址
     //        $ship = JporderService::getShip($model->ID);
     $ship = PapOrderAddress::model()->find("OrderID=:ID", array(":ID" => $model->ID))->attributes;
     $data['Consignee'] = $ship['ShippingName'] ? $ship['ShippingName'] : '';
     $data['Mobile'] = $ship['Mobile'] ? $ship['Mobile'] : '';
     $data['Phone'] = $ship['TelePhone'] ? $ship['TelePhone'] : '';
     $data['Delivery'] = Area::getCity($ship['Province']) . Area::getCity($ship['City']) . Area::getCity($ship['Area']) . $ship['Address'];
     $data['ZipCode'] = $ship['ZipCode'] ? $ship['ZipCode'] : '';
     //获取卖方基本信息
     $seller = $this->getSeller($model->SellerID);
     $data['OrganName'] = $seller['organName'];
     $data['ContactPhone'] = $seller['Phone'];
     $data['QQ'] = $seller['QQ'];
     $data['Address'] = Area::getCity($seller['province']) . Area::getCity($seller['city']) . Area::getCity($seller['area']);
     $model1 = PapOrderGoods::model()->findAll("OrderID=:ID", array(":ID" => $model->ID));
     foreach ($model1 as $key => $value) {
         $data['goods'][$key]['ID'] = $value['ID'];
         $data['goods'][$key]['CreateTime'] = F::msubstr(date("Y-m-d", $value['CreateTime']));
         $data['goods'][$key]['GoodsNum'] = F::msubstr($value['GoodsNum']);
         $data['goods'][$key]['GoodsOE'] = F::msubstr($value['GoodsOE']);
         $data['goods'][$key]['GoodsName'] = F::msubstr($value['GoodsName']);
         $data['goods'][$key]['Brand'] = F::msubstr($value['Brand']);
         $data['goods'][$key]['Price'] = $value['Price'];
         $data['goods'][$key]['editPrice'] = $value['ProPrice'] ? $value['ProPrice'] : $value['Price'];
         $data['goods'][$key]['ShipCost'] = $value['ShipCost'];
         $data['goods'][$key]['Quantity'] = $value['Quantity'];
         $data['goods'][$key]['PN'] = $value['PN'];
         $data['goods'][$key]['ReQuantity'] = $value['ReQuantity'];
         $data['goods'][$key]['GoodsAmount'] = "¥" . $value['GoodsAmount'];
     }
     $this->renderPartial('orderexport', array('row' => $data));
 }
示例#24
0
文件: index.php 项目: zwq/unpei
                                        <td>
                                        <?php 
        if (!empty($model['userID'])) {
            // $cpnames = DealerCpname::model()->findAll("OrganID = " . $dealer['userID']);
            $cpnames = DealerCpname::model()->findAll("OrganID = " . $model['userID']);
            //var_dump($cpnames);
            $k = 1;
            foreach ($cpnames as $cpname) {
                if ($k == 1) {
                    $cp .= $cpname['BigName'] . ' ' . $cpname['SubName'] . ' ' . $cpname['CpName'];
                } else {
                    $cp .= ',' . $cpname['BigName'] . ' ' . $cpname['SubName'] . ' ' . $cpname['CpName'];
                }
                $k++;
            }
            echo F::msubstr($cp);
            $cp = '';
        }
        ?>
                                        </td>
                                        <td ><?php 
        echo $model['mobile_phone'];
        ?>
 <?php 
        echo $model['contactName'];
        ?>
</td>
                                        <td ><?php 
        Area::showCity($model['province']);
        Area::showCity($model['city']);
        Area::showCity($model['area']);
示例#25
0
 public function actionGetpushmess()
 {
     $organID = Commonmodel::getOrganID();
     $criteria = new CDbCriteria();
     $criteria->order = "t.ID DESC ";
     //排序条件:t.CreateTime,t.ID倒叙
     $criteria->addCondition("t.OrganID = {$organID}", "AND");
     $search = $_GET['search'];
     $keyword = $_GET['keyword'];
     $sendway = $_GET['sendway'];
     $month = $_GET['month'];
     if (!empty($search)) {
         // 关联到另一张表,手机号,姓名
         // 1.通过姓名或手机号查到 联系人ID;
         // 2. 通过联系人ID 查到 推送信息ID;
         $sql = "select distinct PushID from tbl_push_contact_relation where ContactID in (select id  from tbl_business_contacts where name like '%{$search}%' OR phone like '%{$search}%')";
         $pushIDs = DBUtil::queryAll($sql);
         foreach ($pushIDs as $value) {
             $pushID[] = $value['PushID'];
         }
         // 3. 通过推送信息ID 查出推送信息
         $criteria->addInCondition("ID", $pushID);
     }
     if (!empty($keyword)) {
         // 内容关键字
         $criteria->addSearchCondition('Content', "{$keyword}", "AND");
     }
     if (!empty($month)) {
         $recomtime = time();
         if ($month == 1) {
             // 1个月
             $recomtime -= 24 * 60 * 60 * 30 * 1;
         } elseif ($month == 3) {
             // 3个月
             $recomtime -= 24 * 60 * 60 * 30 * 3;
         } elseif ($month == 6) {
             // 6个月
             $recomtime -= 24 * 60 * 60 * 30 * 6;
         } elseif ($month == 12) {
             // 1年
             $recomtime -= 24 * 60 * 60 * 30 * 12;
         } else {
             $recomtime -= 24 * 60 * 60 * 30 * 44;
         }
         $criteria->addCondition("t.SendTIme >= {$recomtime} ", 'and');
     }
     if (!empty($sendway)) {
         $criteria->addCondition("t.SendWay = {$sendway}", 'and');
     }
     $count = Pushmessage::model()->count($criteria);
     $pages = new CPagination($count);
     $pages->pageSize = $_GET['rows'];
     $pages->applyLimit($criteria);
     $pushmess = Pushmessage::model()->findAll($criteria);
     $pushinfo = array();
     foreach ($pushmess as $key => $pushm) {
         $pushinfo[$key]['ID'] = $pushm['ID'];
         $pushinfo[$key]['content'] = $pushm['Content'];
         $pushinfo[$key]['content2'] = F::msubstr($pushm['Content']);
         $pushinfo[$key]['sendway'] = $pushm['SendWay'] == 1 ? "邮件" : "短信";
         $pushinfo[$key]['sendtime'] = date("Y年m月d日", $pushm['SendTime']);
         $pushinfo[$key]['sendto'] = $this->getsenders($pushm['ID']) . '个';
     }
     $rs = array('total' => $count, 'rows' => $pushinfo);
     echo json_encode($rs);
 }