Example #1
0
 public function run()
 {
     //         $cri = new CDbCriteria(array(
     //             'condition'=>'is_show = 1',
     //             'order'=>'sort_order asc, id desc'
     //         ));
     //         $CustomerService = CustomerService::model()->findAll($cri);
     //         $this->render('customerService', array(
     //             'CustomerService'=>$CustomerService
     //         ));
     $dealerid = Yii::app()->request->getParam('dealerid') ? Yii::app()->request->getParam('dealerid') : Yii::app()->request->getParam('dealer');
     if ($dealerid) {
         $csparams['organID'] = $dealerid;
         $csparams['type'] = 1;
         $csinfo = CsService::getcslists($csparams);
         $seller = DefaultService::sellerstore($dealerid);
     }
     if (Yii::app()->request->getParam('goods')) {
         $goodsid = Yii::app()->request->getParam('goods');
         $criteria = new CDbCriteria();
         $criteria->condition = " t.OrganID!=''";
         // 上架的和没有删除的商品
         $model = PapGoods::model()->findByPk($goodsid, $criteria);
         if ($model['OrganID']) {
             $csparams['organID'] = $model['OrganID'];
             $csparams['type'] = 1;
             $csinfo = CsService::getcslists($csparams);
             $seller = DefaultService::sellerstore($model['OrganID']);
         }
     }
     $this->render('customerService', array('csinfo' => $csinfo, 'seller' => $seller));
 }
Example #2
0
 public function actionGetgoods()
 {
     $subid = Yii::app()->request->getParam('subid');
     $organID = Yii::app()->user->getOrganID();
     $goods = DefaultService::getsubgoods(array('subid' => $subid, 'organID' => $organID));
     //$goods=RPCClient::call('DefaultService_getsubgoods',array('subid'=>$subid,'organID'=>$organID));
     echo json_encode($goods);
 }
Example #3
0
 public function actionIndex()
 {
     $this->pageTitle = Yii::app()->name . '-商城首页';
     if (Yii::app()->user->isServicer()) {
         $menu = DefaultService::getmenu('修理厂菜单');
         $params['rootID'] = $menu['ID'];
         $navparams['rootID'] = $menu['ID'];
     } else {
         $this->redirect(array('/pap/sellerorder/index'));
     }
     $params["scope"] = "sliderbar";
     //指定定查询范围
     //获取菜单数组
     $menuArr = FrontMenu::getChildMenu($params);
     //        $navparams['scope']='sliderbar';
     //        $navArr = FrontMenu::getChildMenu($navparams);
     $this->render("index", array('menuArr' => $menuArr));
 }
Example #4
0
 public function run()
 {
     //大类子类数据源
     $main = DefaultService::getMainCategorys(0);
     $main = DefaultService::findChild($main, 0);
     $maincate = DefaultService::findsub($main);
     //获取是经销商还是服务店菜单
     $params = M::getRoot();
     //组装参数
     $params["scope"] = "sliderbar";
     //指定定查询范围
     //获取菜单数组
     $navarr = FrontMenu::getChildMenu($params);
     foreach ($navarr as $key => $val) {
         if ($val['name'] != '信息管理') {
             unset($navarr[$key]);
             continue;
         }
     }
     $this->render('topNav', array('MainCategory' => $maincate, 'permenu' => $navarr));
 }
Example #5
0
                foreach ($MainCategory as $key => $cate) {
                    ?>
                                                                    <?php 
                    if ($cate["Name"] == $val) {
                        ?>
                                                                        <?php 
                        foreach ($MainCategory[$key]['children'] as $k => $v) {
                            ?>
                                                                            <div class="float_l">
                                                                                <b class='overflow'><?php 
                            echo $v['Name'];
                            ?>
</b>
                                                                                <ul class="standname">
                                                                                    <?php 
                            $stand = DefaultService::getMainCategorys($v['ID']);
                            if (is_array($stand)) {
                                foreach ($stand as $sk => $sv) {
                                    if (in_array($sk, array(0, 1, 2))) {
                                        ?>
                                                                                                <li class='overflow'><a href="javascript:void(0)"  title='<?php 
                                        echo $sv['Name'];
                                        ?>
'><?php 
                                        echo $sv['Name'];
                                        ?>
</a></li>
                                                                                                <?php 
                                    }
                                }
                                ?>
Example #6
0
 public function actionIndex()
 {
     $this->pageTitle = Yii::app()->name . '-经销商店铺';
     $dealerid = Yii::app()->request->getParam('dealerid');
     $model = Organ::model()->findByPk($dealerid, "Identity=2");
     if (!$model) {
         $this->redirect(array('/pap/home/index'));
     }
     if (!isset($dealerid) || empty($dealerid)) {
         throw new CHttpException(404, 'Invalid request. Please do not repeat this request again.');
     }
     $orderGet = Yii::app()->request->getParam('order');
     $brandGet = Yii::app()->request->getParam('brand');
     $priceGet = Yii::app()->request->getParam('price');
     $skwd1 = urldecode(Yii::app()->request->getParam('skwd'));
     $skwd = MallService::checkKey($skwd1);
     $sub = Yii::app()->request->getParam('sub');
     $ispro = Yii::app()->request->getParam('ispro');
     $partslevel = Yii::app()->request->getParam('partslevel');
     //车型车系
     $cookie = Yii::app()->request->getCookies();
     //var_dump($cookie);
     $car['make'] = $cookie['mallmake']->value;
     $car['series'] = $cookie['mallseries']->value;
     $car['year'] = $cookie['mallyear']->value;
     $car['model'] = $cookie['mallmodel']->value;
     //获取商品品牌
     $brandparams['dealerid'] = $dealerid;
     $brandparams['type'] = 2;
     $brandparams['brand'] = $brandGet;
     $brandparams['sub'] = $sub;
     $brandparams['skwd'] = $skwd;
     $brandparams['car'] = $car;
     $brandModel = MallService::getDealerbrand($brandparams);
     //$brandModel = MallService::getBrand($brandparams);
     $brandData = $brandModel['data'];
     $brand = $brandModel['brand'];
     //价格区间
     $priceModel = MallService::getPrice(array('price' => $priceGet));
     $priceData = $priceModel['data'];
     $price = $priceModel['price'];
     //获得排序
     $orderData = $this->getOrder($orderGet);
     //获取url
     $get = $this->getSearchParams($_GET);
     $params = array('order' => $orderData[0], 'dealerid' => $dealerid, 'skwd' => $skwd, 'brand' => $brandGet, 'price' => $price['cond'], 'car' => $car, 'sub' => $sub, 'ispro' => $ispro, 'rows' => 12, 'resource' => "mall", 'partslevel' => $partslevel, 'type' => 3, 'organID' => Yii::app()->user->getOrganID());
     //获取适用车型text
     //$carmodeltxt = MallService::getCarmodeltxt($car);
     //经销商店铺信息
     $seller = DefaultService::sellerstore($dealerid);
     //店铺积分
     $TotalScore = DefaultService::getrecord($dealerid);
     //获取大类名称
     if ($sub) {
         $big = Gcategory::model()->findByPk($sub);
     }
     //获取商品
     $goods = MallService::getGoodsData($params);
     $rows = $this->Getmaincate($dealerid);
     $cate = $this->findsub($rows);
     // var_dump($cate);exit;
     //底部分页
     //推荐商品
     //获取经销商客服列表
     $csparams['organID'] = $dealerid;
     $csparams['type'] = 1;
     $csinfo = CsService::getcslists($csparams);
     $data = array('seller' => $seller, 'csinfo' => $csinfo, 'TotalScore' => $TotalScore, 'dataProvider' => $goods['dataProvider'], 'pages' => $this->getShortPage($goods["count"], $params['rows']), 'dealerID' => $dealerid, 'order' => $orderData, 'get' => $get, 'cate' => $cate, 'displayType' => MallService::getDisplayType("seller_displayType"), 'params' => array('brand' => $brand, 'price' => $price, 'ispro' => $ispro, 'partslevel' => $partslevel), 'brand' => $brandData, 'price' => $priceData, 'order' => $orderData, 'bigid' => $big['ParentID']);
     $this->render('index', $data);
 }
Example #7
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));
 }
Example #8
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));
 }
Example #9
0
 public function actionQuota()
 {
     Yii::import('application.modules.user.UserModule');
     Yii::import('application.modules.pap.services.DefaultService');
     $t = $_SERVER['REQUEST_TIME'];
     if ($_GET['Handle'] == 'adddefault') {
         $params['organID'] = 0;
         $params['UserID'] = 0;
         $params['subject'] = '由你配系统默认参数未设置提醒';
         $remind = '由你配系统默认配额提醒百分比设置,已添加默认值为: ' . $_GET['Default'] . '。系统参数类别为:system,key名为:QuotaRemind';
         $params['remind'] = $remind;
         $params['warn'] = $remind;
         DefaultService::sendwarnemail($params);
         die;
     }
     $params['organID'] = isset($_GET['OrganID']) ? $_GET['OrganID'] : '0';
     $params['UserID'] = isset($_GET['UserID']) ? $_GET['UserID'] : '0';
     $time = isset($_GET['Time']) ? $_GET['Time'] : '100';
     $username = isset($_GET['username']) ? $_GET['username'] : '******';
     $route = isset($_GET['Route']) ? str_replace('-', '/', $_GET['Route']) : 'fail url';
     $params['subject'] = '由你配用户操作配额异常提醒';
     $remind = '用户 ' . $username . ' 于 ' . date('Y-m-d H:i:s', $t) . ' 操作配额异常';
     $warn = '用户 ' . $username . ' 于 ' . date('Y-m-d H:i:s', $t) . ' 在 ' . $route . ' 操作配额异常' . '。当前操作次数为' . $time . '次';
     $params['remind'] = $remind;
     $params['warn'] = $warn;
     DefaultService::sendwarnemail($params);
 }