Esempio n. 1
0
 public function actionLogincheck()
 {
     Yii::import('application.modules.user.UserModule');
     Yii::import('application.modules.pap.services.DefaultService');
     $time = $_SERVER['REQUEST_TIME'];
     //$organID = Yii::app()->user->getOrganID(); 获取不到
     $organID = isset($_GET['OrganID']) ? $_GET['OrganID'] : '0';
     $UserID = isset($_GET['UserID']) ? $_GET['UserID'] : '0';
     //$username = Yii::app()->user->getState('userName');
     $username = isset($_GET['username']) ? $_GET['username'] : '******';
     $ip = isset($_GET['ip']) ? $_GET['ip'] : '127.0.0.1';
     $ipnum = sprintf("%u", ip2long($ip));
     //登陆地
     $loginaddrsql = ' select Province,City from jpd_ip where ' . $ipnum . ' between inet_aton(beginip) and inet_aton(endip)';
     $loginaddrres = Yii::app()->jpdb->createCommand($loginaddrsql)->queryRow();
     if (!$loginaddrres) {
         //系统未录入ip对应的地址
         $remind = '用户 ' . $username . ' 于 ' . date('Y-m-d H:i', $time) . ' 异常登陆';
         $warn = '用户 ' . $username . ' 于 ' . date('Y-m-d H:i', $time) . ' 异常登陆,登录IP为: ' . $ip . ',此ip在嘉配ip库中无记录。';
     } else {
         //判断用户是否在允许地登陆
         $allowloginsql = ' select ID from jpd_login_address where OrganID=' . $organID . ' and Province=' . $loginaddrres['Province'] . ' and (City=' . $loginaddrres['City'] . ' or City=0 or ' . $loginaddrres['City'] . '=0)';
         $allowloginres = Yii::app()->jpdb->createCommand($allowloginsql)->queryRow();
         if ($allowloginres) {
             //用户在允许登陆地登陆
             return;
         } else {
             //用户不在允许登陆地登陆,判断是否位于危险省份
             //用户当前登陆地址
             $loginaddr = Area::getCity($loginaddrres['Province']) . Area::getCity($loginaddrres['City']);
             $risksql = 'select ID from jpd_risk_area where Province=' . $loginaddrres['Province'] . ' and (City=' . $loginaddrres['City'] . ' or City=0)';
             $riskres = Yii::app()->jpdb->createCommand($risksql)->queryRow();
             //获取机构信息
             $organsql = 'select Province,City,Area,Address from jpd_organ where ID=' . $organID;
             $organres = Yii::app()->jpdb->createCommand($organsql)->queryRow();
             $organaddr = Area::getCity($organres['Province']) . Area::getCity($organres['City']) . Area::getCity($organres['Area']) . $organres['Address'];
             if ($riskres) {
                 //用户在危险地区登陆
                 $remind = '用户 ' . $username . ' 于 ' . date('Y-m-d H:i', $time) . ' 异常登陆';
                 $warn = '用户 ' . $username . ' 于 ' . date('Y-m-d H:i', $time) . ' 在 ' . $loginaddr . ' 登陆(该地址属于警告地址),该账号所属机构地址为: ' . $organaddr;
             } else {
                 //用户不在危险地区登陆
                 $remind = '用户 ' . $username . ' 于 ' . date('Y-m-d H:i', $time) . ' 异常登陆';
                 $warn = '用户 ' . $username . ' 于 ' . date('Y-m-d H:i', $time) . ' 在 ' . $loginaddr . ' 登陆,该账号所属机构地址为: ' . $organaddr;
             }
         }
     }
     $params['organID'] = $organID;
     $params['UserID'] = $UserID;
     $params['subject'] = '由你配用户异常登陆提醒';
     $params['remind'] = $remind;
     $params['warn'] = $warn;
     DefaultService::sendwarnemail($params);
 }
Esempio n. 2
0
 public static function returnidgetaddress($ReturnID)
 {
     $criteria = new CDbCriteria();
     $criteria->addCondition(" t.ReturnID = " . $ReturnID, "AND");
     $model = PapReturnAddress::model()->find($criteria);
     return Area::getCity($model->Province) . Area::getCity($model->City) . Area::getCity($model->Area) . $model->Address;
 }
Esempio n. 3
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 {
Esempio n. 4
0
</td>
                                <td><?php 
        echo F::msubstr($model['phone']);
        ?>
</td>
                                <td><?php 
        if ($model['jiapart_ID']) {
            echo F::msubstr($model['jiapart_ID']);
        } else {
            echo "无";
        }
        ?>
</td>
                                <td><?php 
        if ($model['province']) {
            $address = Area::getCity($model['province']) . Area::getCity($model['city']) . Area::getCity($model['area']) . $model['address'];
            echo F::msubstr($address);
        } else {
            echo "无";
        }
        ?>
</td>
                                <td><?php 
        if ($model['email']) {
            echo F::msubstr($model['email']);
        } else {
            echo "无";
        }
        ?>
</td>
                                <td><?php 
Esempio n. 5
0
 public function actionList()
 {
     $province = Yii::app()->request->getParam('province');
     $city = Yii::app()->request->getParam('city');
     $brand = Yii::app()->request->getParam('brand');
     $criteria = new CDbCriteria();
     $criteria->addCondition('Identity=2 and IsBlack="0" and IsFreeze="0" and Status="1"');
     if ($province) {
         $criteria->addCondition('Province=' . $province, 'AND');
     }
     if ($city) {
         $criteria->addCondition('City=' . $city, 'AND');
     }
     if (!empty($brand)) {
         $ids = $this->getdealerbybrand($brand);
         $criteria->addInCondition('ID', $ids);
     }
     $criteria->order = 'Sort ASC';
     $organ = Organ::model()->findAll($criteria);
     $organ = array();
     if (isset($organ)) {
         foreach ($organ as $key => $val) {
             $organ[$key] = $val->attributes;
             $organ[$key]['address'] = Area::getCity($val['Province']) . Area::getCity($val['City']) . Area::getCity($val['Area']);
             $brand = PapBrand::model()->find('OrganID=:organ', array(':organ' => $val['ID']));
             $organ[$key]['brandname'] = $brand['BrandName'];
         }
     }
     echo json_encode($organ);
 }
Esempio n. 6
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);
 }
Esempio n. 7
0
            <div style="clear:both"></div>
            <?php 
if ($data->Status > 1 && $data->Status != 5 && $data->Status != 6) {
    ?>
                <p class=" m-top20"><b>收货地址:</b>
                    <span class="m-left">
                        <?php 
    echo isset($returnaddress['ShippingName']) ? $returnaddress['ShippingName'] : '';
    ?>
,
                        <?php 
    echo isset($returnaddress['Mobile']) ? $returnaddress['Mobile'] : '';
    ?>
  ,
                        <?php 
    echo Area::getCity($returnaddress['Province']) . Area::getCity($returnaddress['City']) . Area::getCity($returnaddress['Area']) . $returnaddress['Address'];
    ?>
,
                        <?php 
    echo $returnaddress['ZipCode'];
    ?>
                    </span>
                </p>
            <?php 
}
?>
            <div style="clear:both"></div>
            <p class="m-top20"><b>订单信息</b></p>
            <ul class="mjxx m-top last">
                <li>订单类型:<span>已收货退货订单</span></li>
                <li>退货单编号:<span><?php 
Esempio n. 8
0
                        <?php 
        foreach ($address as $key => $value) {
            ?>
                            <tr class="" >
                                <td class="width50">
                                    <input type="radio" name="addr" value="<?php 
            echo $address[$key]['ID'];
            ?>
"> </td>
                                <td><?php 
            echo $address[$key]['ZipCode'];
            ?>
</td>
                                <td style="width:170px;color:#666"> 
                                    <?php 
            $add = Area::getCity($address[$key]['State']) . Area::getCity($address[$key]['City']) . Area::getCity($address[$key]['District']) . $address[$key]['Address'] . "&nbsp; (" . $address[$key]['ContactName'] . ")收";
            echo $add;
            ?>
                                </td>
                                <td><?php 
            echo $value['Phone'];
            ?>
</td>
                                <td><a  href="javascript:void(0)" onclick="updateaddress(<?php 
            echo $value['ID'];
            ?>
)">修改本地址</a></td></tr>
                        <?php 
        }
        ?>
                    </tbody>
Esempio n. 9
0
 public static function paypal($orderid)
 {
     //获取订单信息
     $order = PapOrder::model()->findByPk($orderid)->attributes;
     //获取卖家支付宝帐号
     $paypal = JpdFinancialPaypal::model()->find('OrganID=:ID', array(':ID' => $order['SellerID']));
     //获取订单收货地址
     $ship = self::getship($orderid);
     $payArr = array();
     $payArr['order_id'] = $order['ID'];
     //订单ID
     $payArr['out_trade_no'] = $order['OrderSN'];
     //订单编号
     $payArr['subject'] = $order["OrderName"];
     //订单名称
     $payArr['seller_email'] = $paypal['PaypalAccount'];
     //卖家的支付宝账号
     $payArr['body'] = '';
     //订单描述
     //        $payArr['price'] = $order['GoodsAmount']/$order['TotalAmount'];   //商品总价
     $payArr['price'] = $order['RealPrice'];
     //商品总价
     //        $payArr['price'] = $order['TotalAmount'];  //商品总价
     $payArr['logistics_fee'] = $order['ShipCost'];
     //物流费
     $payArr['receive_name'] = $ship['ShippingName'];
     //收货人信息
     $payArr['receive_address'] = Area::getCity($ship['Province']) . Area::getCity($ship['City']) . Area::getCity($ship['Area']) . $ship['Address'];
     $payArr['receive_zip'] = $ship['ZipCode'];
     //        $payArr['receive_phone'] = $ship['Mobile'];
     $payArr['receive_mobile'] = $ship['Mobile'];
     return $payArr;
 }
Esempio n. 10
0
 public function actionDetail()
 {
     $serviceID = Yii::app()->user->getOrganID();
     $goodsid = Yii::app()->request->getParam('goods');
     $result = MallService::getredis($goodsid);
     //$payment = 1;
     //$result = MallService::getGoodByID($goodsid, $payment, 'mall');
     if ($result == 'null') {
         echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
         echo "<script>alert('该商品不存在!');window.location.href='" . Yii::app()->createUrl('pap/mall/index') . "'</script>";
         exit;
     } else {
         if ($result == 'nosale') {
             echo '<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';
             echo "<script>alert('该商品已下架!');window.location.href='" . Yii::app()->createUrl('pap/mall/index') . "'</script>";
             exit;
         }
     }
     $result['GoodsID'] = $result['ID'];
     $result['CommentNo'] = PapGoods::model()->findByPk($result['ID'])->attributes['CommentNo'];
     //商品折扣价
     if ($result['IsPro'] != 1) {
         $PriceRatio = MallService::getDisprice($result['OrganID'], $serviceID);
         if ($PriceRatio > 0 && $PriceRatio < 100) {
             $result['DisPrice'] = sprintf('%.2f', $result['Price'] * $PriceRatio / 100);
         }
     }
     $cookie = Yii::app()->request->getCookies();
     $car = array('make' => $cookie['mallmake']->value, 'series' => $cookie['mallseries']->value, 'year' => $cookie['mallyear']->value, 'model' => $cookie['mallmodel']->value);
     $carmodeltext = MallService::getCarmodeltxt($car);
     $res = array();
     if ($car['make'] && $car['series'] && $car['year'] && $car['model']) {
         $params = $car;
         $params['goodsid'] = $goodsid;
         $res = MallService::checkCarfit($params);
     }
     //店内分类
     $rows = $this->Getmaincate($result['OrganID']);
     $cate = $this->findsub($rows);
     //获取经销商客服列表
     $csparams['organID'] = $result['OrganID'];
     $csparams['type'] = 1;
     $csinfo = CsService::getcslists($csparams);
     //大类、子类、标准名称
     if (is_array($result['gcategory']) && !$result['gcategory']['BigName']) {
         $result['BigName'] = $result['gcategory']['BigName'];
         $result['SubName'] = $result['gcategory']['SubName'];
         $result['sub'] = $result['gcategory']['SubParts'];
     } else {
         $cpArr = MallService::getCategory($result['StandCode']);
         $result['BigName'] = $cpArr['BigParts'];
         $result['SubName'] = $cpArr['SubParts'];
         $result['sub'] = $cpArr['sub'];
     }
     //公告信息
     $model = new PapGoodsSendnotice();
     $sellerID = $result['OrganID'];
     $notice = $model->find("OrganID = {$sellerID}");
     //var_dump($data);die;
     //店家积分
     $result['TotalScore'] = DefaultService::getrecord($result['OrganID']);
     //店家信息
     $organInfo = Organ::model()->findByPk($result['OrganID'])->attributes;
     $result['Address'] = array(Area::getCity($organInfo['Province']), Area::getCity($organInfo['City']), Area::getCity($organInfo['Area']));
     $result['spec']['UnitName'] = GoodsUnit::model()->findByPk($result['spec']['Unit'])->attributes['UnitName'];
     //单位
     //最小交易金额
     $result['MinTurnover'] = PapOrderMinTurnover::model()->find("OrganID=:ID", array(":ID" => $result['OrganID']))->attributes['MinTurnover'];
     $this->pageTitle = Yii::app()->name . '-' . "商品详情";
     $this->render('detail', array('r' => $result, 'cate' => $cate, 'carmodeltext' => $carmodeltext, 'res' => $res, 'csinfo' => $csinfo, 'car' => $car, 'data' => $notice));
 }
Esempio n. 11
0
 public function actionOrderGoods()
 {
     $this->layout = '//layouts/base';
     $goodsid = Yii::app()->request->getParam('goods');
     $version = Yii::app()->request->getParam('Version');
     $order = Yii::app()->request->getParam('Order');
     $return = Yii::app()->request->getParam('return');
     $quo = Yii::app()->request->getParam('quo');
     //版本信息
     $good = DealergoodsService::getmongoversion($goodsid, $version);
     $result = $good['GoodsInfo'];
     $result['SellerID'] = $result['OrganID'];
     if ($order) {
         $model = PapOrderGoods::model()->find(array('select' => 'ProPrice as Price,Quantity,MakeID,CarID,Year,ModelID', 'condition' => "OrderID={$order} and GoodsID={$goodsid}"))->attributes;
         $result['Quantity'] = $model['Quantity'];
         $result['Price'] = $model['Price'];
         $car = array('make' => $model['MakeID'], 'series' => $model['CarID'], 'year' => $model['Year'], 'model' => $model['ModelID']);
     } else {
         if ($return) {
             $model = PapReturnGoods::model()->find(array('select' => 'Price,OrderID', 'condition' => "ReturnID='{$return}' and GoodsID='{$goodsid}'"))->attributes;
             $result['Quantity'] = $model['Quantity'];
             $result['Price'] = $model['Price'];
             $ordermodel = PapOrderGoods::model()->find(array('select' => 'MakeID,CarID,Year,ModelID', 'condition' => "OrderID={$model['OrderID']} and GoodsID={$goodsid}"))->attributes;
             $car = array('make' => $ordermodel['MakeID'], 'series' => $ordermodel['CarID'], 'year' => $ordermodel['Year'], 'model' => $ordermodel['ModelID']);
         } else {
             if ($quo) {
                 $model = PapQuotationGoods::model()->findByPk($quo, array('select' => 'Price,Num', 'condition' => "GoodsID='{$goodsid}'"))->attributes;
                 $result['Quantity'] = $model['Num'];
                 $result['Price'] = $model['Price'];
             } else {
                 $this->redirect(array('index'));
             }
         }
     }
     //发货公告
     $model = new PapGoodsSendnotice();
     $notice = $model->find("OrganID = {$result['SellerID']}");
     //商品基本信息
     $result['GoodsID'] = $goodsid;
     $result['BrandName'] = $result['Brand'];
     $goods = PapGoods::model()->findByPk($goodsid, array('select' => 'IsSale,CommentNo'));
     $result['IsSale'] = $goods->attributes['IsSale'];
     $result['CommentNo'] = $goods->attributes['CommentNo'];
     if ($result['oeno']) {
         $oe = '';
         foreach ($result['oeno'] as $v) {
             $oe .= $v . ',';
         }
         $result['OENO'] = substr($oe, 0, -1);
     } else {
         $result['OENO'] = '';
     }
     //最小交易金额
     $result['MinTurnover'] = PapOrderMinTurnover::model()->find("OrganID=:ID", array(":ID" => $result['SellerID']))->attributes['MinTurnover'];
     //店家积分
     $result['TotalScore'] = DefaultService::getrecord($result['SellerID']);
     //店家信息
     $organInfo = Organ::model()->findByPk($result['SellerID'])->attributes;
     $result['OrganName'] = $organInfo['OrganName'];
     $result['QQ'] = $organInfo['QQ'];
     $result['Phone'] = $organInfo['Phone'];
     $result['Address'] = array(Area::getCity($organInfo['Province']), Area::getCity($organInfo['City']), Area::getCity($organInfo['Area']));
     //大类子类标准名称
     $result['StandCodeName'] = Gcategory::model()->find(array('select' => 'Name', 'condition' => "Code='{$result['StandCode']}'"))->attributes['Name'];
     $cpArr = MallService::getCategory($result['StandCode']);
     $result['BigName'] = $cpArr['BigParts'];
     $result['SubName'] = $cpArr['SubParts'];
     $result['sub'] = $cpArr['sub'];
     $result['ValidityType'] = $result['spec']['ValidityType'];
     $result['ValidityDate'] = $result['spec']['ValidityDate'];
     $result['BganCompany'] = $result['spec']['BganCompany'] ? $result['spec']['BganCompany'] : '';
     //标品
     $result['BganGoodsNO'] = $result['spec']['BganGoodsNO'] ? $result['spec']['BganGoodsNO'] : '';
     //标商
     $result['Unit'] = $result['spec']['Unit'] ? $result['spec']['Unit'] : '';
     //单位ID
     $result['UnitName'] = GoodsUnit::model()->findByPk($result['Unit'])->attributes['UnitName'];
     //单位
     $result['MinQuantity'] = $result['pack']['MinQuantity'] ? $result['pack']['MinQuantity'] : '';
     //最小包装
     // 图片
     if (!$result['img']) {
         $result['Images'][0]['ImageUrl'] = 'dealer/goods-img-big.jpg';
         $result['Images'][0]['BigImage'] = 'dealer/goods-img-big.jpg';
     } else {
         foreach ($result['img'] as $k => $v) {
             $result['Images'][$k]['MallImage'] = $v['MallImage'];
             $result['Images'][$k]['ImageUrl'] = $v['ImageUrl'];
             if (!$v['BigImage']) {
                 $result['Images'][$k]['BigImage'] = $v['ImageUrl'];
             } else {
                 $result['Images'][$k]['BigImage'] = $v['BigImage'];
             }
         }
     }
     if (!$result) {
         $this->redirect(array('index'));
     }
     $carmodeltext = MallService::getCarmodeltxt($car);
     $carfit = $car;
     $carfit['goodsid'] = $goodsid;
     $fitres = MallService::checkCarfit($carfit);
     $rows = $this->Getmaincate($result['SellerID']);
     $cate = $this->findsub($rows);
     $this->pageTitle = Yii::app()->name . '-' . "订单商品详情";
     //获取经销商客服列表
     $csparams['organID'] = $result['SellerID'];
     $csparams['type'] = 1;
     $csinfo = CsService::getcslists($csparams);
     $this->render('ordergoods', array('r' => $result, 'cate' => $cate, 'carmodeltext' => $carmodeltext, 'fitres' => $fitres['success'] == 1 ? 1 : 0, 'csinfo' => $csinfo, 'car' => $car, 'data' => $notice, 'goodsid' => $goodsid));
 }
Esempio n. 12
0
}
?>
                <br>
                <span>年销售额:</span>
                <?php 
echo $model['year_sales_volume'];
?>
                <br>
                <span>公司规模:</span>
                <?php 
echo $model['company_scale'];
?>
                <br>
                <span>经营地域:</span>
                <?php 
echo Area::getCity($model['operate_region']);
// $txtprovince['operate_region'];
?>
                <br>
                <span style="display:block;float:left;width:70px;">机构简介:</span>
                <span style=" word-break: break-all;display: block;float: left;width: 470px;overflow:auto;"><?php 
echo $model['synopsis'];
?>
</span>
            </div>
        </div>
        <div class='right-side h400 float-m  bg-white' style="width:386px;height:390px; margin-bottom: 15px">
            <div class="title title-dashed">
                联系方式
                <i class='icon-arr2r-white display-ib'></i>
            </div>
Esempio n. 13
0
 public static function gettab($id)
 {
     $model = self::model()->find('id=:id', array(':id' => $id));
     return 'JH' . sprintf("%04d", $model->id) . ' ' . Area::getCity($model->province) . Area::getCity($model->city) . Area::getCity($model->area) . $model->address;
 }
Esempio n. 14
0
 public static function getOrganinfo($ID, $Name = '')
 {
     $criteria = new CDbCriteria();
     $criteria->addCondition("ID = {$ID}");
     $model = Organ::model()->find($criteria);
     if ($Name == 'Address') {
         return Area::getCity($model->Province) . Area::getCity($model->City) . Area::getCity($model->Area) . $model->Address;
     } else {
         if ($Name == 'all') {
             $model->Area = Area::getCity($model->Province) . Area::getCity($model->City) . Area::getCity($model->Area);
             return $model;
         } else {
             return $model->{$Name};
         }
     }
 }
Esempio n. 15
0
 public static function getGoodByID($id, $payment, $m = '')
 {
     Yii::app()->cache->flush();
     $criteria = new CDbCriteria();
     $criteria->condition = "t.ISdelete = 1 and t.OrganID!=''";
     // 上架的和没有删除的商品
     $criteria->with = array("img", 'spec', 'pack');
     $model = PapGoods::model()->findByPk($id, $criteria);
     if (!$model) {
         return false;
     } else {
         if ($model->IsSale == 0) {
             if ($m == 'mall') {
                 return 'nosale';
             } else {
                 return false;
             }
         }
     }
     $data = array();
     $sellerID = $model->OrganID;
     $discount = PapOrderDiscount::model()->find(array("condition" => " OrderType = 1"));
     if ($discount) {
         if ($payment == 1) {
             $dis = $discount['OrderAlipay'];
         } else {
             if ($payment == 2) {
                 $dis = $discount['OrderLogis'];
             }
         }
         if (isset($dis) && !empty($dis)) {
             $dis = $dis;
         } else {
             $dis = 100;
         }
     } else {
         $dis = 100;
     }
     //获取该经销商最小交易额
     $turnover = PapOrderMinTurnover::model()->find("OrganID=:ID", array(":ID" => $model['OrganID']));
     if ($turnover) {
         $data["MinTurnover"] = $turnover['MinTurnover'];
     }
     $data['Version'] = $model->Version;
     $data['discount'] = $dis;
     //商品基本信息
     $data['GoodsID'] = $id;
     $data['Name'] = $model['Name'];
     $data['GoodsNO'] = $model['GoodsNO'];
     $data['CommentNo'] = $model['CommentNo'];
     $data['Info'] = $model['Info'];
     $data['Memo'] = $model['Memo'];
     $data['IsSale'] = $model['IsSale'];
     $data['PartsLevel'] = $model['PartsLevel'];
     $data['code'] = $model['StandCode'];
     if ($model['BrandID']) {
         $sql = "select BrandName from pap_brand where ID={$model['BrandID']}";
         $res = Yii::app()->papdb->createCommand($sql)->queryRow();
     }
     $data['BrandName'] = $res['BrandName'];
     $organID = Yii::app()->user->getOrganID();
     //商品价格
     $priceRatio = self::getContactprice($model['OrganID'], $organID);
     $data['Price'] = $model['Price'];
     $data['LogisticsPrice'] = 0;
     $data['PriceRatio'] = $priceRatio['PriceRatio'] > 0 && $priceRatio['PriceRatio'] <= 100 ? $priceRatio['PriceRatio'] : 100;
     $data['DisPrice'] = sprintf("%.2f", $model['Price'] * $data['PriceRatio'] / 100);
     // 折扣价,小数点后面保留两位
     if ($model['IsPro'] == 1) {
         if (!is_null($model['ProPrice']) && $model['ProPrice']) {
             $data['ProPrice'] = $model['ProPrice'];
         }
     }
     //店家信息
     $organInfo = Organ::model()->findByPk($model['OrganID'])->attributes;
     $data['OrganName'] = $organInfo['OrganName'];
     $data['SellerID'] = $model['OrganID'];
     $data['QQ'] = $organInfo['QQ'];
     $data['Phone'] = $organInfo['Phone'];
     //$address = self::getOrganAddress($organInfo['Province'], $organInfo['City'], $organInfo['Area']);
     $data['Address'] = array(Area::getCity($organInfo['Province']), Area::getCity($organInfo['City']), Area::getCity($organInfo['Area']));
     //商品OE号
     $data['OENO'] = PapGoods::model()->getOENOSByGoodsID($id);
     //$data['LogisticsPrice'] = $goods['LogisticsPrice'];
     //商品大类、子类、标准名称
     $cpArr = self::getCategory($model['StandCode']);
     $data['BigParts'] = $cpArr['BigParts'];
     $data['SubParts'] = $cpArr['SubParts'];
     $data['CpName'] = $cpArr['CpName'];
     $data['sub'] = $cpArr['sub'];
     $data['BganCompany'] = $model->spec->BganCompany ? $model->spec->BganCompany : '';
     //标品
     $data['BganGoodsNO'] = $model->spec->BganGoodsNO ? $model->spec->BganGoodsNO : '';
     //标商
     $data['Unit'] = $model->spec->Unit ? $model->spec->Unit : '';
     //单位ID
     $data['UnitName'] = GoodsUnit::model()->findByPk($data['Unit'])->attributes['UnitName'];
     //单位
     $data['MinQuantity'] = $model->pack->MinQuantity ? $model->pack->MinQuantity : '';
     //最小包装
     //        $data['pLength'] = $model->pack->Volume ? $model->pack->Volume : ''; //体积
     //        $data['Weight'] = $model->pack->Weight ? $model->pack->Weight : ''; //重量
     $data['ValidityType'] = $model->spec->ValidityType;
     $data['ValidityDate'] = $model->spec->ValidityDate;
     // 图片
     if (!$model->img) {
         $data['Images'][0]['ImageUrl'] = 'dealer/goods-img-big.jpg';
     } else {
         foreach ($model->img as $v) {
             $data['Images'][] = $v->attributes;
         }
     }
     return $data;
 }
Esempio n. 16
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));
 }
Esempio n. 17
0
File: index.php Progetto: zwq/unpei
        echo Yii::app()->createUrl('servicer/servicedetail/detail', array('dealer' => $v['ID']));
        ?>
">公司黄页</a>
                                <span style="padding:0px 3px">|</span><a target="_blank" href="<?php 
        echo Yii::app()->baseUrl;
        ?>
/pap/inquiryorder/index">询报价</a>
                            </span>
                        </div>
                        <p class="jxs_tel m-top5">手机:<?php 
        echo $v['Phone'];
        ?>
</p> 
                        <div style="height:auto" class="jxs_addr m-top5">
                            <div style="width:145px;margin-left:40px; text-indent:0px;color:#888">地址:<?php 
        echo Area::getCity($v['Province']) . Area::getCity($v['City']) . Area::getCity($v['Area']);
        ?>
<br>
                                <span style=""><?php 
        echo $v['Address'];
        ?>
</span>
                            </div>
                        </div>  
                    </div>
                </li>
            <?php 
    }
    ?>
            <div style="clear:both"></div>
        </ul>
Esempio n. 18
0
                    </ul>
                    <div style="clear:both"></div>
                </div>
            <?php 
    }
    ?>
        </div>
    <?php 
}
?>
<!--   <a target="_blank" href="http://wpa.qq.com/msgrd?v=3&amp;uin=<?php 
//echo $seller['QQ']
?>
&amp;site=qq&amp;menu=yes;"><img border="0" SRC=http://wpa.qq.com/pa?p=1:88888888:6 alt="点击这里给我发消息" align="absmiddle"></a>-->
    <div class="shop_name" style="line-height:16px;">
        <div style="float:left;width:70px;text-align: right;margin:5px 0px">公司名称:</div>
        <div class="lanse float_l" style="width:140px;margin:5px 0px"><?php 
echo $seller['OrganName'];
?>
</div>
        <div style="clear:both"></div>
    </div>
    <div class="shop_addr" style="line-height:16px;">
        <div style="float:left;width:70px;text-align: right;margin:5px 0px">所 在 地:</div>
        <div class="lanse float_l" style="width:140px;margin:5px 0px"><?php 
echo Area::getCity($seller['Province']) . Area::getCity($seller['City']) . Area::getCity($seller['Area']);
?>
</div>
        <div style="clear:both"></div>
    </div>
</div>
Esempio n. 19
0
 public static function getSendAddress($id)
 {
     //河北省石家庄市长安区小河西村 张(收) 13147218913
     $model = PapOrderAddress::model()->find("OrderID={$id}")->attributes;
     $str = '';
     if ($model) {
         $address = array(Area::getCity($model['Province']), Area::getCity($model['City']), Area::getCity($model['Area']));
         $str .= $address[2] ? $address[0] . '' . $address[1] . '' . $address[2] : $address[0] . '' . $address[1];
         $str .= $model['Address'] . ' (' . $model['ShippingName'] . ') ';
         if ($model['Mobile'] && $model['TelePhone']) {
             $str .= $model['Mobile'] . ' ' . $model['TelePhone'];
         } else {
             if ($model['Mobile']) {
                 $str .= $model['Mobile'];
             } else {
                 if ($model['TelePhone']) {
                     $str .= $model['TelePhone'];
                 }
             }
         }
     }
     return $str;
 }
Esempio n. 20
0
        ?>
</td>
			<td name='companyname'><?php 
        echo $service['serviceName'];
        ?>
</td>
			<td name='phone'><?php 
        echo $service['serviceCellPhone'];
        ?>
</td>
			<td name='email'><?php 
        echo $service['serviceEmail'];
        ?>
</td>
			<td><?php 
        $address = Area::getCity($service['serviceProvince']) . Area::getCity($service['serviceCity']) . Area::getCity($service['serviceArea']) . $service['serviceAddress'];
        echo F::msubstr($address);
        ?>
</td>
			<td><?php 
        echo CHtml::button('选择', array('class' => 'btn-small', 'id' => 'opt'));
        ?>
</td>
		</tr>
		<?php 
        $i++;
    }
    ?>
	</tbody>
	<?php 
} else {
Esempio n. 21
0
 public function actionGetaddlogs()
 {
     //      $address = Yii::app()->request->getParams('ID');
     $address = $_GET['ID'];
     $criteria = new CDbCriteria();
     $criteria->addCondition("LogisticsID={$address}");
     $model = LogisticsAddress::model()->findAll($criteria);
     if (!empty($model)) {
         foreach ($model as $key => $showAddress) {
             $add[$key]['ID'] = $showAddress['ID'];
             //传入要删除的弹框地址 ID
             $add[$key]['add'] = Area::getCity($showAddress['Province']) . Area::getCity($showAddress['City']) . Area::getCity($showAddress['Area']);
         }
     }
     echo json_encode($add);
 }
Esempio n. 22
0
        ?>
</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>		
Esempio n. 23
0
        ?>
        <?php 
        // echo $model['organName']
        ?>
                                        </td>
                                        <td>
        <?php 
        echo $model['FoudingDate'] != '' ? $model['FoudingDate'] . "年成立" : '未登记';
        ?>
                                        </td>
                                        <td><?php 
        echo $model['Phone'];
        ?>
</td>
                                        <td><?php 
        $add = Area::getCity($model['province']) . Area::getCity($model['city']) . Area::getCity($model['area']);
        echo F::msubstr($add);
        ?>
</td>
                                        <td><?php 
        // echo !empty($model['BusinessCate']) ? F::msubstr($model['BusinessCate'],0,0)  : "暂无"
        ?>
                                            <?php 
        $cpnames = MakeOrganGroupRelation::model()->findAll("userID=" . $model['userID']);
        //echo $model['userID'];
        foreach ($cpnames as $cpname) {
            // $cpname['father_code'].' '.
            $cp .= $cpname['children_code'] . ',';
        }
        echo F::msubstr($cp);
        $cp = '';
Esempio n. 24
0
File: view.php Progetto: zwq/unpei
<?php

$this->breadcrumbs = array('会员列表' => array('admin'), $model->UserName);
$this->menu = array(array('label' => '创建会员', 'icon' => 'plus', 'url' => array('create')), array('label' => '修改会员', 'icon' => 'pencil', 'url' => array('update', 'id' => $user->ID)), array('label' => '删除会员', 'icon' => 'trash', 'url' => '#', 'linkOptions' => array('submit' => array('delete', 'id' => $model->ID), 'confirm' => 'Are you sure to delete this item?')), array('label' => '管理会员', 'icon' => 'cog', 'url' => array('admin')), array('label' => '会员列表', 'icon' => 'list', 'url' => array('/admin/admin')));
?>
<h1><?php 
echo '查看会员' . ' "' . $user->UserName . '"';
?>
</h1>

<?php 
$attributes = array('ID', 'OrganName', 'Email');
array_push($attributes, array('name' => 'Phone', 'value' => $model->Phone), array('name' => 'Type', 'value' => Organ::itemAlias("usertype", $model->Type)), array('name' => 'IsFreeze', 'value' => Organ::itemAlias('freeze', $model->IsFreeze)), array('name' => 'IsBlack', 'value' => Organ::itemAlias('IsBlack', $model->IsBlack)));
array_push($attributes, array('name' => 'Status', 'value' => Organ::itemAlias("UserStatus", $model->Status)), array('name' => 'Identity', 'value' => Organ::itemAlias("Identity", $model->Identity)), array('name' => 'AllAddress', 'value' => Area::getCity($model->Province) . Area::getCity($model->City) . Area::getCity($model->Area) . $model->Address), array('name' => 'Recommend'));
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => $attributes));
Esempio n. 25
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);
 }
Esempio n. 26
0
File: papeva.php Progetto: zwq/unpei
?>
                    <div class="eav-jg-img float_l"><img src="<?php 
echo F::uploadUrl() . $OrganPhoto['Path'];
?>
"></div>
                    <div class="eav-jg-info float_l">
                        <p><b><?php 
echo $OrganInfo['OrganName'];
?>
</b></p>
                        <div class="xy-jg"><?php 
echo $xylvstr;
?>
</div>
                        <p><?php 
echo Area::getCity($OrganInfo['Province']) . Area::getCity($OrganInfo['City']) . Area::getCity($OrganInfo['Area']) . $OrganInfo['Address'];
?>
</p>
                        <p><?php 
echo $OrganInfo['TelPhone'];
?>
</p>
                    </div>
                    <div class="clear"></div>
                </div>
            </div>
            <!--                        <div class="jg-eav float_l">
                                        <div style="width:300px; margin-left:60px; margin-top:40px ">
            <?php 
//foreach ($evarr as $ekey => $evalue):
?>