Esempio n. 1
0
 public function checkexists($attribute, $params)
 {
     if (!$this->hasErrors()) {
         // we only want to authenticate when no input errors
         if (strpos($this->login_or_email, "@")) {
             $organ = Organ::model()->findByAttributes(array('Email' => $this->login_or_email));
             if ($organ) {
                 $user = User::model()->findByAttributes(array('OrganID' => $organ->ID, 'IsMain' => '1'));
                 $this->user_id = $user->ID;
             }
         } else {
             $user = User::model()->findByAttributes(array('UserName' => $this->login_or_email));
             if ($user->IsMain == '0') {
                 //子账户
                 $this->addError("login_or_email", UserModule::t("请找主帐号管理员修改密码!"));
             } else {
                 $this->user_id = $user->ID;
             }
         }
         if ($user === null) {
             if (strpos($this->login_or_email, "@")) {
                 $this->addError("login_or_email", UserModule::t("Email is incorrect."));
             } else {
                 $this->addError("login_or_email", UserModule::t("Username is incorrect."));
             }
         }
     }
 }
Esempio n. 2
0
 /**
  * Recovery password
  */
 public function actionRecovery()
 {
     $form = new UserRecoveryForm();
     if (Yii::app()->user->id) {
         $this->redirect(Yii::app()->controller->module->returnUrl);
     } else {
         $email = isset($_GET['email']) ? $_GET['email'] : '';
         $activkey = isset($_GET['activkey']) ? $_GET['activkey'] : '';
         if ($email && $activkey) {
             $form2 = new UserChangePassword();
             $organ = Organ::model()->findByAttributes(array('Email' => $email));
             $find = User::model()->findByAttributes(array('OrganID' => $organ->ID, 'IsMain' => '1'));
             if (isset($find) && $find->ActiveKey == $activkey) {
                 if (isset($_POST['UserChangePassword'])) {
                     $form2->attributes = $_POST['UserChangePassword'];
                     if ($form2->validate()) {
                         $find->PassWord = Yii::app()->controller->module->encrypting($form2->password);
                         $find->ActiveKey = Yii::app()->controller->module->encrypting(microtime() . $form2->password);
                         User::model()->updateByPk($find->ID, array('PassWord' => $find->PassWord, 'ActiveKey' => $find->ActiveKey));
                         Yii::app()->user->setFlash('recoveryMessage', UserModule::t("New password is saved."));
                         $this->redirect(array('recovery/finish'));
                     }
                 }
                 $this->render('changepassword', array('form' => $form2));
             } else {
                 Yii::app()->user->setFlash('recoveryMessage', UserModule::t("Incorrect recovery link."));
                 $this->redirect(Yii::app()->controller->module->recoveryUrl);
             }
         } else {
             if (isset($_POST['UserRecoveryForm'])) {
                 $status = 2;
                 $form->attributes = $_POST['UserRecoveryForm'];
                 if ($form->validate()) {
                     $user = User::model()->findByPk($form->user_id);
                     //激活码
                     if ($user->ActiveKey == null) {
                         $user->ActiveKey = $user->encrypting(microtime() . $user->PassWord);
                         $user->verifyPassword = $user->PassWord;
                         $user->save();
                     }
                     //获取邮箱
                     $organinfo = Organ::model()->findByPk($user->OrganID);
                     $activation_url = 'http://' . $_SERVER['HTTP_HOST'] . $this->createUrl(implode(Yii::app()->controller->module->recoveryUrl), array("activkey" => $user->ActiveKey, "email" => $organinfo->Email));
                     $subject = UserModule::t("找回 {site_name}密码", array('{site_name}' => Yii::app()->name));
                     $message = UserModule::t("You have requested the password recovery site {site_name}. To receive a new password, go to {activation_url}.", array('{site_name}' => Yii::app()->name, '{activation_url}' => $activation_url . ' '));
                     $res = UserModule::sendMail($organinfo->Email, $subject, $message);
                     if ($res == 'ok') {
                         Yii::app()->user->setFlash('recoveryMessage', UserModule::t("Please check your email. An instructions was sent to your email address."));
                     } else {
                         $this->render('recovery', array('form' => $form, 'emailError' => $res));
                         exit;
                     }
                     $this->refresh();
                 }
             }
             $this->render('recovery', array('form' => $form));
         }
     }
 }
Esempio n. 3
0
 public function run()
 {
     $userid = Yii::app()->user->id;
     $organID = Yii::app()->user->getOrganID();
     $sessionlist = RemindService::getSessionList($userid);
     $logo = F::uploadUrl() . Organ::model()->findByPk($organID)->attributes['Logo'];
     $this->render('privatechat', array("userid" => $userid, "sessionlist" => $sessionlist, 'logo' => $logo));
 }
Esempio n. 4
0
 public function actionEditlist()
 {
     $this->pageTitle = Yii::app()->name . '-' . "修改客户级别";
     $id = Yii::app()->request->getParam('id');
     $DealerID = Yii::app()->user->getOrganID();
     $organname = Organ::model()->findByPk($id);
     $model = PapClientType::model()->find('DealerID = :DealerID and ServiceID = :ServiceID', array(':DealerID' => $DealerID, ':ServiceID' => $id));
     $this->render('editlist', array('organname' => $organname, 'model' => $model));
 }
Esempio n. 5
0
 public function actionIndex()
 {
     $this->pageTitle = Yii::app()->name . '-账号激活';
     $this->layout = '//layouts/login';
     if (Yii::app()->user->isGuest) {
         $this->redirect(array('/user/login'));
     }
     $organID = Yii::app()->user->getOrganID();
     $organ = Organ::model()->findByPk($organID);
     if ($organ->Status == 1) {
         if (Yii::app()->user->isServicer()) {
             $this->redirect(array('/pap/home/index'));
         } else {
             if (Yii::app()->user->isDealer()) {
                 $this->redirect(array('/pap/sellerorder/index'));
             }
         }
     } else {
         if ($organ->Status == 2) {
             $this->redirect(array('/user/activecompany/index'));
         }
     }
     $model = new User('active');
     $model->agreement = 1;
     $this->performAjaxValidation($model);
     if ($_POST['User']) {
         $userid = Yii::app()->user->id;
         $organID = Yii::app()->user->getOrganID();
         $user = $model->findByPk($userid);
         if ($user->PassWord === md5(trim($_POST['User']['PassWord']))) {
             $newpassword = trim($_POST['User']['NewPassword']);
             $model->PassWord = md5($newpassword);
             $pass = User::model()->updateByPk($userid, array('PassWord' => $model->PassWord));
             //$organ=Organ::model()->updateByPk($organID,array('Status'=>'2'));
             $res = Yii::app()->jpdb->createCommand()->update('jpd_organ', array('Status' => '2'), 'ID=' . $organID);
             $this->redirect(array('/user/activecompany/index'));
         } else {
             $this->redirect(array('/user/activation/index'));
         }
     }
     $this->render('index', array('model' => $model));
 }
Esempio n. 6
0
 public function actionDetail()
 {
     //$model = Dealer::model()->find("userID=:userID", array(":userID" => $_GET['dealer']));
     $organID = Yii::app()->request->getParam("dealer");
     $model = Organ::model()->with('dealer')->findByPK($organID);
     //主营品牌
     $brands = Brand::model()->findAll("OrganID = {$organID}");
     $data = array();
     foreach ($brands as $key => $brand) {
         $data[$key]['brandname'] = $brand['BrandName'];
     }
     //主营车系
     $dealerv = DealerVehicles::model()->findAll("OrganID=:userID", array(":userID" => $organID));
     //主营品类
     $cpnames = OrganCpname::model()->findAll('OrganID=:userID', array(':userID' => $organID));
     // 机构照片
     $photosql = 'select * from `{{organ_photo}}` where OrganID=' . $organID;
     $organphotos = Yii::app()->jpdb->createCommand($photosql)->queryAll();
     $this->render("detail", array('model' => $model, 'organphotos' => $organphotos, 'dealerv' => $dealerv, 'showcpnames' => $cpnames, 'data' => $data));
 }
Esempio n. 7
0
 public function actionEditlogo()
 {
     $organID = Yii::app()->user->OrganID;
     //organ表单验证
     $model = Organ::model()->findByPK($organID);
     if ($model->Logo) {
         //删除
         $ftp = new Ftp();
         $res = $ftp->delete_file($model->Logo);
         $ftp->close();
     }
     //获得一个CUploadedFile的实例
     $file = CUploadedFile::getInstanceByName('Logo');
     $rs = array('code' => 100, 'msg' => '上传失败!' . $ImgName . '已经上传');
     $upload = Yii::app()->params['uploadPath'] . 'tmp/logo/' . $organID . '/';
     $path = Yii::app()->params['uploadPath'] . 'tmp/';
     if (!is_dir($upload)) {
         mkdir($upload, 0777, true) or die('创建失败');
         chmod($upload, 0777);
     }
     // 判断实例化是否成功
     if (is_object($file) && get_class($file) === 'CUploadedFile') {
         $model->Logo = 'logo/' . $organID . '/' . 'file_' . date("YmdHis") . '_' . rand(1000, 9999) . '.' . $file->extensionName;
         //定义文件保存的名称
     }
     /* else{  // 若果失败则应该是什么图片  
        $model->url = './assets/upfile/noPic.jpg';
        } */
     if ($model->save()) {
         $file->saveAs($path . $model->Logo, true);
         $ftp = new Ftp();
         $res = $ftp->uploadfile($path . $model->Logo, $model->Logo);
         $ftp->close();
         @unlink($path . $model->Logo);
     }
     $this->redirect(array('index'));
 }
Esempio n. 8
0
 public static function getGoodsData($params)
 {
     $sql = self::getGoodsSql($params);
     if ($params['SellerID'] && $params['IsSale'] == 0) {
         $sql["countSql"] = str_replace('dg.IsSale=1', 'dg.IsSale=0', $sql["countSql"]);
         $sql["sql"] = str_replace('dg.IsSale=1', 'dg.IsSale=0', $sql["sql"]);
     }
     $res = Yii::app()->papdb->createCommand($sql["countSql"])->queryAll();
     $count = $res[0]['count'];
     $dataProvider = new CSqlDataProvider($sql["sql"], array('db' => Yii::app()->papdb, 'totalItemCount' => $count, 'pagination' => array('pageSize' => $params['rows'] ? $params['rows'] : 10)));
     $goods = $dataProvider->getData();
     foreach ($goods as $k => $v) {
         $image = self::getOneGoodsImage($v['ID']);
         if (!$image) {
             $goods[$k]['image'] = F::baseUrl() . '/upload/' . 'dealer/default-goods.png';
         } else {
             $goods[$k]['image'] = F::baseUrl() . '/upload/' . $image;
         }
         //获取标准名称
         if ($v['StandCode']) {
             $goods[$k]['cpname'] = Gcategory::model()->find(array('select' => 'Name', 'condition' => "Code = '{$v['StandCode']}'"))->attributes['Name'];
         }
         //卖家信息
         $goods[$k]['dealername'] = Organ::model()->findByPk($v['OrganID'], array('select' => 'OrganName'))->attributes['OrganName'];
         if (!$params["resource"] || $params["resource"] != "mall") {
             //OE号
             $goods[$k]['OENOS'] = self::getOENOSByGoodsID($v['ID']);
             // 车型车系
             //$carmodel = explode('、', self::getVehicleByGoodsID($v['ID']));
             //$goods[$k]['vehicle'] = $carmodel[0];
             //$goods[$k]['vehicle'] = self::getOneVehicleByGoodsID($v['ID']);
         }
     }
     $dataProvider->setData($goods);
     return array('dataProvider' => $dataProvider, 'count' => $count);
 }
Esempio n. 9
0
 /**
  * Authenticates a user.
  * The example implementation makes sure if the username and password
  * are both 'demo'.
  * In practical applications, this should be changed to authenticate
  * against some persistent user identity storage (e.g. database).
  * @return boolean whether authentication succeeds.
  */
 public function authenticate()
 {
     $user = User::model()->findByAttributes(array('UserName' => $this->username));
     //验证账户是否存在,存在则获取其机构ID
     if ($user === null) {
         $this->errorCode = self::ERROR_USERNAME_INVALID;
     } else {
         $organ = Organ::model()->findByPk($user->OrganID);
         $employ = OrganEmployees::model()->findByPk($user->EmployeID);
         //判断密码是否错误
         if (Yii::app()->getModule('user')->encrypting($this->password) !== $user->PassWord) {
             $this->errorCode = self::ERROR_PASSWORD_INVALID;
         } else {
             if ($organ->IsBlack == 1) {
                 $this->errorCode = self::ERROR_BLACK;
             } else {
                 if ($organ->IsFreeze == 1) {
                     $this->errorCode = self::ERROR_FREEZE;
                 } else {
                     if ($organ->ExpirationTime && time() > $organ->ExpirationTime) {
                         $this->errorCode = self::ERROR_EXPIRATION;
                     } else {
                         if ($employ && $employ->ExpireTime && time() > $employ->ExpireTime) {
                             $this->errorCode = self::ERROR_EXPIRATION;
                         } else {
                             $this->_id = $user->ID;
                             $this->username = $user->UserName;
                             $this->errorCode = self::ERROR_NONE;
                         }
                     }
                 }
             }
         }
     }
     return !$this->errorCode;
 }
Esempio n. 10
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);
 }
Esempio n. 11
0
 public static function exportAccount($params)
 {
     $select1 = "OrderSN as No,CreateTime,Payment,BuyerID,RealPrice as Price,BuyerName,1";
     $seaCon1 = self::getOrderCond($params, $select1);
     $data1 = Yii::app()->papdb->createCommand($seaCon1)->queryAll();
     $select2 = "ReturnNO as No,CreateTime,PayMethod as Payment,ServiceID as BuyerID,-Price as Price,2";
     $seaCon2 = self::getReturnCond($params, $select2);
     $data2 = Yii::app()->papdb->createCommand($seaCon2)->queryAll();
     $data = array_merge($data1, $data2);
     $timeKey = array();
     foreach ($data as $v) {
         $timeKey[] = $v['CreateTime'];
     }
     array_multisort($timeKey, SORT_DESC, $data);
     //导出
     $objectPHPExcel = new PHPExcel();
     $objectPHPExcel->setActiveSheetIndex(0);
     //excel表头的输出
     $objectPHPExcel->getActiveSheet()->mergeCells('A1:F1');
     $objectPHPExcel->getActiveSheet()->setCellValue('A1', '月度账单表');
     $objectPHPExcel->setActiveSheetIndex(0)->getStyle('A1')->getFont()->setSize(24);
     $objectPHPExcel->setActiveSheetIndex(0)->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
     $time = $params['uyear'] . '年' . $params['umonth'] . '月';
     $objectPHPExcel->getActiveSheet()->mergeCells('A2:F2');
     $objectPHPExcel->getActiveSheet()->setCellValue('A2', $time);
     $objectPHPExcel->setActiveSheetIndex(0)->getStyle('A2')->getFont()->setSize(14);
     $objectPHPExcel->setActiveSheetIndex(0)->getStyle('A2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
     $objectPHPExcel->getActiveSheet()->getStyle('A2:F2')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     //表格头的输出
     $objectPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(30);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('A4', '时间');
     $objectPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(25);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('B4', '交易类型');
     $objectPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(20);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('C4', '名称');
     $objectPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(40);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('D4', '修理厂名称');
     $objectPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(30);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('E4', '订单/退货单编号');
     $objectPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(20);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('F4', '收入/支出');
     //设置行高
     $objectPHPExcel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(20);
     $objectPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(40);
     $objectPHPExcel->getActiveSheet()->getRowDimension('2')->setRowHeight(20);
     $objectPHPExcel->getActiveSheet()->getRowDimension('3')->setRowHeight(30);
     $objectPHPExcel->getActiveSheet()->getStyle('A4:F4')->getFont()->setBold(true);
     //设置居中
     $objectPHPExcel->getActiveSheet()->getStyle('A4:F4')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
     $objectPHPExcel->getActiveSheet()->getStyle('A4:F4')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
     $income = 0;
     $pay = 0;
     $n = 1;
     foreach ($data as $product) {
         if ($product[1] == 1) {
             $name = '订单收入';
             $payment = $product['Payment'] == 1 ? '支付宝担保' : '物流代收款';
             $income += $product['Price'];
         } else {
             $name = '退款支付';
             $payment = $product['Payment'] == 0 ? '支付宝担保' : '物流代收款';
             $pay += $product['Price'];
         }
         if (!$product['BuyerName']) {
             $product['BuyerName'] = Organ::model()->findByPk($product['BuyerID'])->attributes['OrganName'];
         }
         //明细的输出
         $objectPHPExcel->getActiveSheet()->setCellValue('A' . ($n + 4), date('Y-m-d H:i:s', $product['CreateTime']));
         $objectPHPExcel->getActiveSheet()->setCellValue('B' . ($n + 4), $payment);
         $objectPHPExcel->getActiveSheet()->setCellValue('C' . ($n + 4), $name);
         $objectPHPExcel->getActiveSheet()->setCellValue('D' . ($n + 4), $product['BuyerName']);
         $objectPHPExcel->getActiveSheet()->setCellValue('E' . ($n + 4), $product['No']);
         $objectPHPExcel->getActiveSheet()->setCellValue('F' . ($n + 4), $product['Price']);
         $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':F' . ($n + 4))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         //            $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':F' . ($n + 4))
         //                    ->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
         $n += 1;
     }
     $total = $income + $pay;
     $objectPHPExcel->getActiveSheet()->mergeCells('A3:B3');
     $objectPHPExcel->getActiveSheet()->setCellValue('A3', '收入:' . $income);
     $objectPHPExcel->getActiveSheet()->mergeCells('C3:D3');
     $objectPHPExcel->getActiveSheet()->setCellValue('C3', '支出:' . $pay);
     $objectPHPExcel->getActiveSheet()->mergeCells('E3:F3');
     $objectPHPExcel->getActiveSheet()->setCellValue('E3', '合计:' . $total);
     $objectPHPExcel->setActiveSheetIndex(0)->getStyle('A3:F3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
     $objectPHPExcel->getActiveSheet()->getStyle('A3:F3')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
     $objectPHPExcel->getActiveSheet()->getStyle('A3:F3')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objectPHPExcel->getActiveSheet()->getPageSetup()->setHorizontalCentered(true);
     $objectPHPExcel->getActiveSheet()->getPageSetup()->setVerticalCentered(false);
     ob_end_clean();
     ob_start();
     header('Content-Type : application/vnd.ms-excel');
     header('Content-Disposition:attachment;filename="' . iconv("utf-8", "gb2312", $time . "账单表-") . '.xls"');
     $objWriter = PHPExcel_IOFactory::createWriter($objectPHPExcel, 'Excel5');
     $objWriter->save('php://output');
 }
Esempio n. 12
0
    echo $data->ID;
    ?>
"> 
            <span class=""><?php 
    echo date('Y年m月d日', $data->CreateTime);
    ?>
</span>
            <span style="margin-left:20px">订单号:</span><span><?php 
    echo $data->OrderSN;
    ?>
</span>
            <?php 
    if ($data->BuyerName) {
        $BuyerName = $data->BuyerName;
    } else {
        $BuyerName = Organ::model()->findByPk($data->BuyerID, array('select' => 'OrganName'))->attributes['OrganName'];
    }
    ?>
            <span class="m_left40"><?php 
    echo $BuyerName;
    ?>
</span>
        </p>
        <div class="sp_div">
            <?php 
    if ($data->goodsinfo) {
        $count = count($data->goodsinfo);
        ?>
                <ul class="splb_order float_l  tb_head m_left5">
                    <?php 
        foreach ($data->goodsinfo as $v) {
Esempio n. 13
0
File: _form.php Progetto: zwq/unpei
<?php 
echo $form->passwordField($model, 'verifyPassword', array('value' => $model->PassWord));
echo $form->error($model, 'verifyPassword', array('class' => 'help-block', 'style' => 'color:#B94A48'));
?>

<?php 
echo $form->textFieldRow($organ, 'OrganName');
echo $form->textFieldRow($organ, 'Email', array('prepend' => '@', 'style' => 'width:180px;'));
echo $form->textFieldRow($organ, 'Phone');
echo $form->dropDownListRow($organ, 'Identity', Organ::itemAlias('Identity'), array('empty' => '请选择机构类型'));
?>

<?php 
echo $form->dropDownListRow($organ, 'Status', Organ::itemAlias('UserStatus'));
echo $form->dropDownListRow($organ, 'Type', Organ::itemAlias('usertype'));
$res = Organ::model()->findAll('Identity=:iden', array(':iden' => 2));
echo $form->labelEx($organ, 'RecomID');
echo Chtml::dropDownList('Organ[Recommend]', !empty($organ['Recommend']) ? $organ['Recommend'] : '', CHtml::listData($res, 'OrganName', 'OrganName'), array('class' => 'width90 select', 'id' => 'recm', 'empty' => '请选择推荐人'));
?>
<label  class="control-label">地址:</label>
<?php 
$state_data = Area::model()->findAll("Grade=:grade", array(":grade" => 1));
$state = CHtml::listData($state_data, "ID", "Name");
$s_default = $organ->isNewRecord ? '' : $organ->Province;
echo Chtml::dropDownList('Organ[Province]', $organ->Province, $state, array('class' => 'easyui-validatebox width90 select', 'id' => 'province', 'empty' => '请选择省份', 'ajax' => array('type' => 'GET', 'url' => Yii::app()->createUrl('/admin/Dynamiccities'), 'update' => '#city', 'data' => 'js:"province="+jQuery(this).val()')));
//empty since it will be filled by the other dropdown
$c_default = $organ->isNewRecord ? '' : $organ->City;
if (!$organ->isNewRecord) {
    $city_data = Area::model()->findAll("ParentID=:parent_id", array(":parent_id" => $organ->Province));
    $city = CHtml::listData($city_data, "ID", "Name");
}
Esempio n. 14
0
 public static function saveRemind($params, $organtype = 3)
 {
     $organ = Organ::model()->findByPk($params['OrganID'], array('select' => 'OrganName,Phone,Email,LinkmanPhone'))->attributes;
     $promoter = Organ::model()->findByPk($params['PromoterID'], array('select' => 'OrganName,Phone,Email'))->attributes;
     switch ($organtype) {
         //生产商
         case '1':
             break;
             //经销商
         //经销商
         case '2':
             switch ($params['type']['key']) {
                 case '1':
                     $content = $promoter['OrganName'] . '向您下了一笔待付款的订单,订单号为:' . $params['No'] . '!';
                     $link = Yii::app()->CreateUrl('pap/sellerorder/detail', array('ID' => $params['HandleID']));
                     break;
                 case '2':
                     $content = $promoter['OrganName'] . '的订单' . $params['No'] . '待发货,请您尽快发货!';
                     $link = Yii::app()->CreateUrl('pap/sellerorder/detail', array('ID' => $params['HandleID']));
                     //如果是命令行执行
                     if (PHP_SAPI == 'cli') {
                         $link = 'http://www.unipei.com/pap/sellerorder/detail&ID=' . $params['HandleID'];
                     }
                     break;
                 case '3':
                     $content = $promoter['OrganName'] . '向您发布了询价单,单号为:' . $params['No'] . '。请注意确认!';
                     $link = Yii::app()->CreateUrl('pap/inquirylist/viewquo', array('inqid' => $params['HandleID']));
                     break;
                 case '4':
                     $content = $promoter['OrganName'] . '向您申请了退货单' . $params['No'] . ',请尽快审核!';
                     if (in_array($params['THDStatus'], array(11, 12, 13, 14))) {
                         $link = Yii::app()->CreateUrl('pap/dealerreturn/audit2', array('ID' => $params['HandleID']));
                     } else {
                         $link = Yii::app()->CreateUrl('pap/dealerreturn/audit', array('ID' => $params['HandleID']));
                     }
                     break;
                 case '5':
                     $content = $promoter['OrganName'] . '的退货单' . $params['No'] . '已发货,请注意查收!';
                     if (in_array($params['THDStatus'], array(11, 12, 13, 14))) {
                         $link = Yii::app()->CreateUrl('pap/dealerreturn/orderinfo2', array('ID' => $params['HandleID']));
                     } else {
                         $link = Yii::app()->CreateUrl('pap/dealerreturn/orderinfo', array('ID' => $params['HandleID']));
                     }
                     break;
             }
             break;
             //修理厂
         //修理厂
         case '3':
             switch ($params['type']['key']) {
                 case '1':
                     $content = "您向" . $promoter['OrganName'] . '下了一笔订单,订单号为 ' . $params['No'] . '。请尽快登录由你配系统付款!';
                     $link = Yii::app()->CreateUrl('pap/orderreview/detail', array('orderid' => $params['HandleID']));
                     break;
                 case '2':
                     $content = "您向" . $promoter['OrganName'] . '下的订单' . $params['No'] . '已发货,请注意收货!';
                     $link = Yii::app()->CreateUrl('pap/orderreview/detail', array('orderid' => $params['HandleID']));
                     break;
                 case '3':
                     $content = $promoter['OrganName'] . '向您发布了报价单,单号为' . $params['No'] . '。请注意确认!';
                     if ($params['link']) {
                         //修理厂先发送了询价单  经销商根据询价单生成报价单
                         $link = $params['link'];
                     } else {
                         $link = Yii::app()->CreateUrl('pap/quotationlist/viewquo', array('quoid' => $params['HandleID']));
                     }
                     break;
                 case '4':
                     $content = "您向" . $promoter['OrganName'] . '申请的退货单' . $params['No'] . '未通过!';
                     if (in_array($params['THDStatus'], array(11, 12, 13, 14))) {
                         $link = Yii::app()->CreateUrl('pap/buyreturn/orderinfo2', array('ID' => $params['HandleID']));
                     } else {
                         $link = Yii::app()->CreateUrl('pap/buyreturn/orderinfo', array('ID' => $params['HandleID']));
                     }
                     break;
                 case '5':
                     $content = "您向" . $promoter['OrganName'] . '申请的退货单' . $params['No'] . '已通过,请尽快发货!';
                     if (in_array($params['THDStatus'], array(11, 12, 13, 14))) {
                         $link = Yii::app()->CreateUrl('pap/buyreturn/send', array('ID' => $params['HandleID']));
                     } else {
                         $link = Yii::app()->CreateUrl('pap/buyreturn/send', array('ID' => $params['HandleID']));
                     }
                     break;
             }
             break;
     }
     $params['content'] = $content;
     $params['linkurl'] = $link;
     $params['organ'] = $organ;
     $params['promoter'] = $promoter;
     //保存到数据库
     self::sendSYSRemind($params);
     //发送邮件
     if (in_array(1, $params['Method'])) {
         self::sendEmailRemind($params);
     }
     //发送短信
     if (in_array(2, $params['Method'])) {
         self::sendSMSRemind($params);
     }
 }
Esempio n. 15
0
?>
                            <?php 
foreach ($data as $k => $v) {
    ?>
                                <?php 
    if ($v[1] == 1) {
        $name = '订单收入';
        $payment = $v['Payment'] == 1 ? '支付宝担保' : '物流代收款';
        $income += $v['Price'];
    } else {
        $name = '退款支付';
        $payment = $v['Payment'] == 0 ? '支付宝担保' : '物流代收款';
        $pay += $v['Price'];
    }
    if (!$v['BuyerName']) {
        $v['BuyerName'] = Organ::model()->findByPk($v['BuyerID'])->attributes['OrganName'];
    }
    ?>
                                <tr class="">
                                    <td class="tb_bo ft_cl2 bo_top"><?php 
    echo date('Y-m-d H:i:s', $v['CreateTime']);
    ?>
</td>
                                    <td class="tb_bo ft_cl2 bo_top"><?php 
    echo $payment;
    ?>
</td>
                                    <td class="tb_bo ft_cl2 bo_top"><?php 
    echo $name;
    ?>
</td>
Esempio n. 16
0
 public function actionDetail()
 {
     $this->layout = "//layouts/base";
     //$model = Dealer::model()->find("userID=:userID", array(":userID" => $_GET['dealer']));
     $organID = Yii::app()->request->getParam("dealer");
     $model = Organ::model()->with('dealer')->findByPK($organID);
     //主营品牌
     // $brands = Brand::model()->findAll("OrganID = $organID");
     $brandsql = "select * from pap_dealer_brand db join pap_brand b on db.brandID=b.ID where db.OrganID={$organID}";
     $brandres = Yii::app()->papdb->CreateCommand($brandsql)->queryAll();
     //主营车系
     $dealerv = JpdDealerVehicles::model()->findAll("OrganID=:userID", array(":userID" => $organID));
     //主营品类
     $cpnames = JpdOrganCpname::model()->findAll('OrganID=:userID', array(':userID' => $organID));
     // 机构照片
     $photosql = 'select * from `{{organ_photo}}` where Purpose = 0 AND OrganID=' . $organID;
     $organphotos = Yii::app()->jpdb->createCommand($photosql)->queryAll();
     $Brand_sql = "SELECT b.BrandName, a.ID, a.url1, a.url2 FROM pap_dealer_brand AS a LEFT JOIN pap_brand AS b " . "ON a.BrandID = b.ID WHERE a.OrganID = {$organID}";
     $Brandphotos = Yii::app()->papdb->createCommand($Brand_sql)->queryAll();
     $this->render("detail", array('model' => $model, 'organphotos' => $organphotos, 'dealerv' => $dealerv, 'showcpnames' => $cpnames, 'brand' => $brandres, 'Brandphotos' => $Brandphotos));
 }
Esempio n. 17
0
 /**
  * 公司信息保存
  */
 public function actionSaveorgan()
 {
     $OrganID = Yii::app()->user->getOrganID();
     $identity = Yii::app()->user->identity;
     $Organ = Yii::app()->request->getParam("Organ");
     $arr = Yii::app()->request->getParam("telPhone");
     $TelPhone = "";
     foreach ($arr as $val) {
         if (empty($val)) {
             continue;
         }
         $TelPhone .= $val . ",";
     }
     $model = Organ::model()->findByPK($OrganID);
     if (empty($model)) {
         $model = new Organ();
     }
     //保存organ数据
     $model->attributes = $Organ;
     $model->TelPhone = trim($TelPhone, ',');
     //判断基本信息是否为空,为空则不提交
     if ($Organ) {
         //接收删除图片的地址
         $photoId = Yii::app()->request->getParam("photoId");
         //判断是否删除图片
         if (!empty($photoId)) {
             $this->delorganphoto($photoId);
         }
         //接收上传图片地址
         $goodsImages = Yii::app()->request->getParam("goodsImages");
         //判断是否有上传图片
         if (!empty($goodsImages)) {
             $this->saveorganphoto($goodsImages);
         }
         //判断是否上传营业执照
         $BLPoto = Yii::app()->request->getParam("BLPoto");
         if ($model->BLPoto != $BLPoto) {
             if (!empty($model->BLPoto)) {
                 $ftp = new Ftp();
                 $ftp->delete_file($model->BLPoto);
                 $ftp->close();
             }
             $model->BLPoto = $BLPoto;
         }
         //判断是否上传门店照片
         $ShopPoto = trim(Yii::app()->request->getParam("ShopPoto"), ",");
         $delShopPoto = trim(Yii::app()->request->getParam("delShopPoto"), ",");
         if ($ShopPoto) {
             $ShopPotos = explode(",", $ShopPoto);
             $delShopPotos = explode(",", $delShopPoto);
             foreach ($ShopPotos as $val) {
                 if (!in_array($val, $delShopPotos)) {
                     $this->savePhotoInfoToMysql($val, $OrganID, 2);
                 }
             }
         }
         $model->Status = 1;
         if ($identity == 1) {
             $this->savemakerdata();
         } elseif ($identity == 2) {
             $this->savedealerdata();
         } elseif ($identity == 3) {
             $this->saveservicedata();
         }
         if (!$model->save()) {
             //var_dump($model->errors);die;
             throw new CHttpException(400, '保存机构信息失败!');
         }
     }
     $this->redirect(array("activation/finish"));
 }
Esempio n. 18
0
 public static function createbuynoworder($params)
 {
     $goods = $params['goods'];
     $payment = $params['payment'];
     $ShipLogis = $params['shiplogis'];
     $ship = $params['ship'];
     $quantity = $params['quantity'];
     $locate = $params['locate'];
     $BuyerID = Yii::app()->user->getOrganID();
     $organ = Organ::model()->findByPk($BuyerID)->attributes;
     $BuyName = $organ['OrganName'];
     $usecouponID = $params['usecouponID'];
     //获取订单最小交易额
     $turnover = PapOrderMinTurnover::model()->find("OrganID=:ID", array(":ID" => $goods['SellerID']));
     $min_price = $turnover['MinTurnover'] ? $turnover['MinTurnover'] : 0;
     //获取经销商订单折扣率--商城订单
     $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;
     }
     $orderArr = array();
     $order_sn = self::gen_order_sn();
     //array("order"=>array(),"goodsList"=> array())
     $orderArr["order"] = array("OrderSN" => "DD" . $order_sn, "OrderName" => "嘉配订单:DD" . $order_sn, "SellerID" => $goods["SellerID"], "SellerName" => $goods["OrganName"], "BuyerID" => $BuyerID, "BuyerName" => $BuyName, "Payment" => $payment, "OrderType" => 1, "Discount" => $dis, "ShipLogis" => $ShipLogis['0'], "Status" => $payment == 1 ? 1 : 2, "CreateTime" => time(), "UpdateTime" => time());
     //收货地址
     $orderArr["address"] = array("ShippingName" => $ship['ContactName'], "ZipCode" => $ship['ZipCode'], "Mobile" => $ship['Phone'], "Province" => $ship['State'], "City" => $ship['City'], "Area" => $ship['District'], "Address" => $ship['Address'], "CreateTime" => time());
     $SellPrice = $goods["ProPrice"] ? $goods["ProPrice"] : $goods["DisPrice"];
     //生成平摊金额
     $amount = round($SellPrice * $dis / 100, 2) * $quantity;
     $GoodsAmount = $amount;
     //$GoodsAmount = round($amount * $dis / 100, 2);
     $avg = 0;
     $SellPrice = round($SellPrice * $dis / 100, 2);
     //定位车系
     $locate = explode('_', $locate);
     $data[] = array("GoodsID" => $goods['GoodsID'], "GoodsNum" => $goods['GoodsNO'], "GoodsOE" => $goods['OENO'], "GoodsName" => $goods['Name'], "CpName" => $goods['CpName'], "Brand" => $goods['BrandName'], "Price" => $goods['Price'], "ProPrice" => $SellPrice, "Quantity" => $quantity, "ShipCost" => $goods['LogisticsPrice'] * $quantity, "GoodsAmount" => $GoodsAmount, "Version" => $goods['Version'], "CreateTime" => time(), "UpdateTime" => time(), "MakeID" => $locate[0], "CarID" => $locate[1], "Year" => $locate[2], "ModelID" => $locate[3]);
     $goodsPrice = $data['0']["GoodsAmount"];
     $shipCost = $data['0']["ShipCost"];
     $totalPrice = $goodsPrice + $shipCost;
     //订单总价
     //订单实付金额折扣率
     $amountPrice = $GoodsAmount;
     //商品总价
     $realPrice = $amountPrice + $shipCost;
     //实付金额:折后价+物流费
     $orderArr["goodsList"] = $data;
     $orderArr["order"]["GoodsAmount"] = $goodsPrice;
     $orderArr["order"]["ShipCost"] = $shipCost;
     $orderArr["order"]["TotalAmount"] = $totalPrice;
     //实付金额
     $orderArr["order"]["RealPrice"] = $realPrice;
     $actparam = array('total' => $totalPrice, 'payment' => $payment);
     $act_res = self::activedecre($actparam);
     if (!empty($act_res) && is_array($act_res)) {
         $orderArr["order"]['PromoID'] = intval($act_res['PromoID']);
         $orderArr["order"]['DecrAmount'] = floatval($act_res["DecrAmount"]);
         $orderArr["order"]['DecrTotal'] = floatval($act_res["DecrTotal"]);
         $orderArr['order']['Type'] = $act_res['Type'];
         $orderArr["order"]["RealPrice"] = floatval($act_res['RealPrice']);
         $orderArr["order"]["TotalAmount"] = floatval($act_res['RealPrice']);
         $orderArr["order"]['CouponID'] = $act_res['CouponID'];
     }
     /*优惠活动 使用优惠券
      * params $decoupon 优惠券内容,$totalPrice订单金额 $orderArr订单数组
      */
     if (isset($usecouponID) && !empty($usecouponID)) {
         $decoupon = self::couponbyID($usecouponID);
         $orderArr = self::usecoupon($decoupon, $totalPrice, $orderArr);
     }
     $orderId = OrderService::create($orderArr);
     return $orderId;
 }
Esempio n. 19
0
 public static function SellCountExport($params)
 {
     $page = $params['page'] ? $params['page'] : 1;
     $pageSize = $params['pageSize'] ? $params['pageSize'] : 3;
     $offset = ($page - 1) * $pageSize;
     $seaCon = self::getOrderCond($params);
     // return $seaCon . " limit $offset,$pageSize";
     $data = Yii::app()->papdb->createCommand($seaCon . " limit {$offset},{$pageSize}")->queryAll();
     //导出
     $objectPHPExcel = new PHPExcel();
     $objectPHPExcel->setActiveSheetIndex(0);
     //报表头的输出
     $objectPHPExcel->getActiveSheet()->mergeCells('A1:G1');
     $objectPHPExcel->getActiveSheet()->setCellValue('A1', '订单交易统计表');
     $objectPHPExcel->setActiveSheetIndex(0)->getStyle('A1')->getFont()->setSize(24);
     $objectPHPExcel->setActiveSheetIndex(0)->getStyle('A1')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
     $objectPHPExcel->getActiveSheet()->mergeCells('A2:B2');
     $time = '';
     if ($params['starttime'] && $params['endtime']) {
         $time = date('Y-m-d', $params['starttime']) . '至' . date('Y-m-d', $params['endtime']);
     } elseif ($params['starttime']) {
         $time = date('Y-m-d', $params['starttime']) . '至' . date('Y-m-d');
     } elseif ($params['endtime']) {
         $time = '~至' . date('Y-m-d', $params['endtime']);
     } else {
         $time = '';
     }
     $objectPHPExcel->getActiveSheet()->setCellValue('A2', $time);
     $objectPHPExcel->setActiveSheetIndex(0)->getStyle('A2')->getFont()->setSize(14);
     $objectPHPExcel->setActiveSheetIndex(0)->getStyle('A2')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_LEFT);
     $objectPHPExcel->getActiveSheet()->getStyle('A2:G2')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     //表格头的输出
     $objectPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(10);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('A3', '序号');
     $objectPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(35);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('B3', '订单编号');
     $objectPHPExcel->getActiveSheet()->getColumnDimension('C')->setWidth(35);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('C3', '下单时间');
     $objectPHPExcel->getActiveSheet()->getColumnDimension('D')->setWidth(30);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('D3', '机构名称');
     $objectPHPExcel->getActiveSheet()->getColumnDimension('E')->setWidth(30);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('E3', '支付方式');
     $objectPHPExcel->getActiveSheet()->getColumnDimension('F')->setWidth(20);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('F3', '订单状态');
     $objectPHPExcel->getActiveSheet()->getColumnDimension('G')->setWidth(15);
     $objectPHPExcel->setActiveSheetIndex(0)->setCellValue('G3', '订单总金额');
     //设置行高
     $objectPHPExcel->getActiveSheet()->getDefaultRowDimension()->setRowHeight(25);
     $objectPHPExcel->getActiveSheet()->getRowDimension('1')->setRowHeight(40);
     $objectPHPExcel->getActiveSheet()->getRowDimension('2')->setRowHeight(20);
     $objectPHPExcel->getActiveSheet()->getRowDimension('3')->setRowHeight(30);
     $objectPHPExcel->getActiveSheet()->getStyle('A3:F3')->getFont()->setBold(true);
     //设置居中
     $objectPHPExcel->getActiveSheet()->getStyle('A3:G3')->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
     $objectPHPExcel->getActiveSheet()->getStyle('A3:G3')->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
     //设置边框
     $objectPHPExcel->getActiveSheet()->getStyle('A3:G3')->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objectPHPExcel->getActiveSheet()->getStyle('A3:G3')->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objectPHPExcel->getActiveSheet()->getStyle('A3:G3')->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objectPHPExcel->getActiveSheet()->getStyle('A3:G3')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objectPHPExcel->getActiveSheet()->getStyle('A3:G3')->getBorders()->getVertical()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $allGoodsAmount = 0;
     $n = 0;
     $no = $offset + 1;
     foreach ($data as $product) {
         //明细的输出
         $objectPHPExcel->getActiveSheet()->setCellValue('A' . ($n + 4), $no);
         $objectPHPExcel->getActiveSheet()->setCellValue('B' . ($n + 4), $product['OrderSN']);
         $objectPHPExcel->getActiveSheet()->setCellValue('C' . ($n + 4), date('Y-m-d H:i:s', $product['CreateTime']));
         if (!$product['BuyerName']) {
             $product['BuyerName'] = Organ::model()->findByPk($product['BuyerID'], array('select' => 'OrganName'))->attributes['OrganName'];
         }
         $objectPHPExcel->getActiveSheet()->setCellValue('D' . ($n + 4), $product['BuyerName']);
         $objectPHPExcel->getActiveSheet()->setCellValue('E' . ($n + 4), self::showOrderPayment($product['Payment']));
         $objectPHPExcel->getActiveSheet()->setCellValue('F' . ($n + 4), self::showOrderStatus($product['Status'], $product['ReturnStatus']));
         $objectPHPExcel->getActiveSheet()->setCellValue('G' . ($n + 4), '¥' . $product['TotalAmount']);
         $allGoodsAmount += $product['TotalAmount'];
         //设置边框
         $currentRowNum = $n + 4;
         $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . $currentRowNum)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
         $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . $currentRowNum)->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
         $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . $currentRowNum)->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . $currentRowNum)->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . $currentRowNum)->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . $currentRowNum)->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . $currentRowNum)->getBorders()->getVertical()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
         $n += 1;
         $no++;
     }
     //设置订单个数
     $objectPHPExcel->getActiveSheet()->setCellValue('D' . ($n + 4), '订单总数');
     $objectPHPExcel->getActiveSheet()->setCellValue('E' . ($n + 4), $n . '个');
     //设置总金额
     $objectPHPExcel->getActiveSheet()->setCellValue('F' . ($n + 4), '订单总额共计');
     $objectPHPExcel->getActiveSheet()->setCellValue('G' . ($n + 4), '¥' . $allGoodsAmount);
     //设置边框
     $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . ($n + 4))->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER);
     $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . ($n + 4))->getAlignment()->setVertical(PHPExcel_Style_Alignment::VERTICAL_CENTER);
     $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . ($n + 4))->getBorders()->getTop()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . ($n + 4))->getBorders()->getLeft()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . ($n + 4))->getBorders()->getRight()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . ($n + 4))->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objectPHPExcel->getActiveSheet()->getStyle('A' . ($n + 4) . ':G' . ($n + 4))->getBorders()->getVertical()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     $objectPHPExcel->getActiveSheet()->getPageSetup()->setHorizontalCentered(true);
     $objectPHPExcel->getActiveSheet()->getPageSetup()->setVerticalCentered(false);
     ob_end_clean();
     ob_start();
     header('Content-Type : application/vnd.ms-excel;charset=gbk');
     header('Content-Disposition:attachment;filename="' . iconv("utf-8", "gb2312", "订单交易统计表-") . date("Ymd") . '.xls"');
     $objWriter = PHPExcel_IOFactory::createWriter($objectPHPExcel, 'Excel5');
     $objWriter->save('php://output');
 }
Esempio n. 20
0
 /**
  * 验证机构名称 手机号码 邮箱是否重复
  */
 public function actionCheckorgan()
 {
     /* $model = Yii::app()->db->createCommand()
        ->select("OrganID as organID")
        ->from("jpd_user")
        ->where("id=:userid", array(":userid" => Yii::app()->user->id))
        ->queryRow(); */
     $OrganID = Yii::app()->user->getOrganID();
     if (empty($OrganID)) {
         $organID = 0;
     } else {
         $organID = $OrganID;
     }
     $name = $_GET['name'];
     if (!empty($name)) {
         $model = Organ::model()->findAll("ID!=:organID and OrganName=:name", array(":organID" => $organID, ":name" => $name));
         if (!empty($model)) {
             $message = "机构名称已存在,不可重复";
         } else {
             $mobilephone = $_GET['mobilephone'];
             if (!empty($mobilephone)) {
                 $model = Organ::model()->findAll("ID!=:organID and Phone=:mobilephone", array(":organID" => $organID, ":mobilephone" => $mobilephone));
                 //                        $model=Yii::app()->db->createCommand()
                 //                            ->select('id')
                 //                            ->from("tbl_user")
                 //                            ->where("id!=:employID and username=:username",  array(":employID"=>$employID,":username"=>$username))
                 //                            ->queryAll();
                 if (!empty($model)) {
                     $message = "手机号码已被使用";
                 } else {
                     $email = $_GET['email'];
                     if (!empty($email)) {
                         $model = Organ::model()->findAll("ID!=:organID and Email=:email", array(":organID" => $organID, ":email" => $email));
                         if (!empty($model)) {
                             $message = "邮箱已被使用";
                         }
                     }
                 }
             }
         }
     }
     if (empty($message)) {
         $result = TRUE;
     } else {
         $result = FALSE;
     }
     $resu['result'] = $result;
     $resu['message'] = $message;
     echo json_encode($resu);
 }
Esempio n. 21
0
File: papeva.php Progetto: zwq/unpei
            <?php 
}
?>
        </div>
    </div>
    <!--满意度评价-->
    <p class="txxx bor_back  m-top10">满意度评价</p>
    <div class="bor_back ">
        <div class="satisfied ">
            <div class="jg-info float_l">
                <div class="triangle-border2 tb-border2"></div>
                <div class="triangle-border2 tb-background2"></div>
                <div style="padding:35px 20px">
                    <?php 
$OrderInfo = PapOrder::model()->findByPK($OrderID);
$OrganInfo = Organ::model()->findByPk($OrderInfo['SellerID']);
$OrganPhoto = OrganPhoto::model()->find("OrganID =:organID", array(':organID' => $OrganInfo['ID']));
$xylevel = EvaluateService::getpets($OrganInfo['Grade']);
if (empty($xylevel) || !$xylevel[0] || !$xylevel[1]) {
    $xylvstr = "<div class='xy-div' title='积分过低'><i class='seller-level0'></i></div>";
} else {
    $xylvstr = '<div class = "xy-div" title = "积分:' . $OrganInfo['Grade'] . '">' . str_repeat("<i class='seller-level" . $xylevel[0] . "'></i>", $xylevel[1]) . '</div>';
}
?>
                    <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'];
Esempio n. 22
0
File: head.php Progetto: zwq/unpei
<link rel="stylesheet" type="text/css" href="<?php 
echo Yii::app()->theme->baseUrl;
?>
/css/newer/xygl.css"  />
<?php 
//机构图片
//$goodsimg = OrganPhoto::model()->findAll("OrganID=:userID", array(":userID" => $organID));
//$imgUrl = $goodsimg[0]->Path;
$goodsimg = Organ::model()->findByPk($organID);
$imgUrl = $goodsimg->Logo;
$oname = $goodsimg->OrganName;
//好评统计
$goodsArr = EvaluateService::getevalgoods(array('OrganID' => $organID));
$goodsArr1 = EvaluateService::getevalgoods(array('OrganID' => $organID, 'm' => 1));
$goodsArr6 = EvaluateService::getevalgoods(array('OrganID' => $organID, 'm' => 6));
$goodsArr12 = EvaluateService::getevalgoods(array('OrganID' => $organID, 'm' => 12));
$total = $goodsArr[1] + $goodsArr[2] + $goodsArr[3];
$goodsscore = $goodsArr[1] - $goodsArr[3];
//信用等级
$xylevel = EvaluateService::getpets($goodsscore);
if (empty($xylevel) || !$xylevel[0] || !$xylevel[1]) {
    $xylvstr = "<div class='xy-div' title='暂无'><i style='color:#888'>暂无</i></div>";
} else {
    $xylvstr = '<div class = "xy-div" title = "积分:' . $goodsscore . '">' . str_repeat("<i class='seller-level" . $xylevel[0] . "'></i>", $xylevel[1]) . '</div>';
}
$total1 = $goodsArr1[1] + $goodsArr1[2] + $goodsArr1[3];
$total6 = $goodsArr6[1] + $goodsArr6[2] + $goodsArr6[3];
$total12 = $goodsArr12[1] + $goodsArr12[2] + $goodsArr12[3];
$praise = $total ? sprintf('%0.1f', $goodsArr[1] * 100 / $total) : 0;
//综合评分
$fwitem = EvaluateService::getevainfo(2);
Esempio n. 23
0
File: index.php Progetto: zwq/unpei
        $("table tbody tr").removeClass("bg-green-light");
        $("table tbody tr").live({
            mouseout: function() {
                $(this).removeClass("tr-hover");
            },
            mouseover: function() {
                $(this).removeClass("tr-hover");
            }
        });
    });
    --></script>
<script>
    $(function(){
<?php 
$organID = Yii::app()->user->getOrganID();
$identity = Organ::model()->findByPK($organID);
?>
                        var fileClass =  <?php 
echo $organID;
?>
;
                        var identity=<?php 
echo $identity['Identity'];
?>
;
                        $("#file_upload").uploadify({
                            'auto'	: true,
                            'queueId'	: 'some_file+queue',
                            'swf'	: Yii_theme_baseUrl + '/js/uploadify/uploadify.swf',
                            'uploader'	: Yii_baseUrl + '/upload/uploadify',
                            'buttonText': '上传机构图片',
Esempio n. 24
0
 public static function getOrder($returnID)
 {
     $orders = array();
     $order = PapReturnOrder::model()->findByPk($returnID);
     $address = Organ::model()->findByPk($order['ServiceID']);
     $orders['ReturnNO'] = $order['ReturnNO'];
     $orders['Price'] = $order['Price'];
     $orders['receive_name'] = $address['OrganName'];
     return $orders;
 }
Esempio n. 25
0
 protected function Getorgan()
 {
     //获取自身机构ID
     $organID = Yii::app()->user->getOrganID();
     $businessContacts = Contacts::model()->findAll('OrganID=:organID and Status=:stu', array(':organID' => $organID, ':stu' => '0'));
     foreach ($businessContacts as $val) {
         if ($val['ContactID']) {
             $ids[] = $val['ContactID'];
         }
     }
     //新增的联系人不能是本人
     $ids[] = $organID;
     $ids = implode(',', $ids);
     $result = Organ::model()->findAll("ID not in({$ids}) and !ISNULL(OrganName)");
     return $result;
 }
Esempio n. 26
0
 public function actionCreateAccount()
 {
     $params = self::accountCond();
     $select1 = "OrderSN as No,CreateTime,Payment,BuyerID,RealPrice as Price,BuyerName";
     $select2 = "ReturnNO as No,CreateTime,PayMethod as Payment,ServiceID as BuyerID,Price";
     if ($params['type'] == 1) {
         $seaCon1 = "select {$select1} from pap_order t where t.Status=9";
         $seaCon1 .= " and SellerID = {$params['OrganID']} and IsDelete = 0";
         $seaCon1 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}";
         $seaCon1 .= " order by CreateTime DESC";
         $data1 = Yii::app()->papdb->createCommand($seaCon1)->queryAll();
         $count1 = Yii::app()->papdb->createCommand(str_replace($select1, 'sum(RealPrice)', $seaCon1))->queryScalar();
     } else {
         if ($params['type'] == 2) {
             $seaCon2 = "select {$select2} from pap_return_order t where t.Status in(4,14)";
             $seaCon2 .= " and DealerID = {$params['OrganID']}";
             $seaCon2 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}";
             $seaCon2 .= " order by CreateTime DESC";
             $data2 = Yii::app()->papdb->createCommand($seaCon2)->queryAll();
             $count2 = Yii::app()->papdb->createCommand(str_replace($select2, 'sum(Price)', $seaCon2))->queryScalar();
         } else {
             $seaCon1 = "select {$select1} from pap_order t where t.Status=9";
             $seaCon1 .= " and SellerID = {$params['OrganID']} and IsDelete = 0";
             $seaCon1 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}";
             $seaCon1 .= " order by CreateTime DESC";
             $data1 = Yii::app()->papdb->createCommand($seaCon1)->queryAll();
             $count1 = Yii::app()->papdb->createCommand(str_replace($select1, 'sum(RealPrice)', $seaCon1))->queryScalar();
             $seaCon2 = "select {$select2} from pap_return_order t where t.Status in(4,14)";
             $seaCon2 .= " and DealerID = {$params['OrganID']}";
             $seaCon2 .= " and t.CreateTime>={$params['starttime']} and t.CreateTime<{$params['endtime']}";
             $seaCon2 .= " order by CreateTime DESC";
             $data2 = Yii::app()->papdb->createCommand($seaCon2)->queryAll();
             $count2 = Yii::app()->papdb->createCommand(str_replace($select2, 'sum(Price)', $seaCon2))->queryScalar();
         }
     }
     $count1 = $count1 ? $count1 : 0;
     $count2 = $count2 ? $count2 : 0;
     $gain = $count1 - $count2;
     $day = date('t', $params['starttime']);
     $organ = Organ::model()->findByPk($params['OrganID'], array('select' => 'OrganName'))->attributes;
     $html = '<div style="height:24px; line-height:24px; background-color:#1f76c8">
             <div style="margin:0 auto; text-align:center">
             <span style="font-family:微软雅黑; font-size:24px; color:#fff; word-spacing:8px; letter-spacing: 1.5px;">' . $params['uyear'] . '年' . $params['umonth'] . '月对账单</span>
             </div>
         </div>
         <div style="font-size:16px; color:#343434; line-height:16px">
             <p style="margin:0px; ">亲爱的' . $organ['OrganName'] . ',您好!</p>
             <p style="margin:0px; ">感谢您使用由你配平台,以下是您' . $params['umonth'] . '月的平台交易明细:</p>
         </div>
         <div style="height:20px; line-height:18px; border-bottom:2px solid #c9c7c7; border-top:2px solid #c9c7c7; background-color:#f2f2f2; padding:0 30px">
             <div style="font-size:16px; font-weight:bold; color:#565656; line-height:18px;float:left">
                 本月净收益: <span style="color:#1f76c8">' . $gain . '</span> 元
             </div>
             <div style="font-size:16px; line-height:18px;float:right">
                 <p style="margin:0px; line-height:15px">
                 	本月总收入: <span style="color:#1f76c8;font-size:14px">' . $count1 . '</span>元
                    	&nbsp;&nbsp;
                    	本月总支出: <span style="color:#1f76c8;font-size:14px">' . $count2 . '</span>元</p>
                 <p style="margin:0px; line-height:15px">
                 	账单周期:' . $params['uyear'] . '年' . $params['umonth'] . '月01日—' . $params['uyear'] . '年' . $params['umonth'] . '月' . $day . '日
                 </p>
     </div>
     </div>';
     Yii::import('application.extensions.tcpdf.*');
     // create new PDF document
     $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
     // 设置文档信息
     $pdf->SetCreator('--');
     $pdf->SetAuthor('北京嘉配科技有限公司');
     $pdf->SetTitle('由你配 - 对账单');
     $pdf->SetSubject('TCPDF Tutorial');
     $pdf->SetKeywords('TCPDF, PDF, PHP');
     // 设置页眉和页脚信恿
     $pdf->SetHeaderData('', 30, '', '', array(0, 64, 255), array(0, 64, 128));
     $pdf->setFooterData(array(0, 64, 0), array(0, 64, 128));
     // 设置页眉和页脚字使
     $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
     $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
     // 设置默认等宽字体
     $pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
     // 设置间距
     $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
     $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
     $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
     // 设置分页
     $pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
     // set image scale factor
     $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
     // 设置字体
     $pdf->SetFont('stsongstdlight', '', 14, true);
     // 添加页面
     $pdf->AddPage();
     // Image example with resizing
     $pdf->Image(F::themeUrl() . '/images/jpd/logo_account.jpg', 20, 28, 30, 18, 'JPG', '', '', true, 150, '', false, false, 0, false, false, false);
     // 设置字体阴影
     //$pdf->setTextShadow(array('enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>array(196,196,196), 'opacity'=>1, 'blend_mode'=>'Normal'));
     // 输出HTML内容
     $pdf->writeHTML($html, true, false, true, false, '');
     if (!empty($data1)) {
         $html = '<p style="color:#1f76c8">订单明细:</p>';
         $pdf->writeHTML($html, true, false, true, false, '');
         // 表格标题
         $header = array('时间', '交易类型', '修理厂名称', '订单编号', '收入(元)');
         // data loading
         $data = array();
         foreach ($data1 as $key => $val) {
             $data[$key][0] = date('Y-m-d', $val['CreateTime']);
             $data[$key][1] = $val['Payment'] == 2 ? '物流代收款' : '支付宝担保';
             if (!$val['BuyerName']) {
                 $val['BuyerName'] = Organ::model()->findByPk($val['BuyerID'], array('select' => 'OrganName'))->attributes['OrganName'];
             }
             $data[$key][2] = $val['BuyerName'];
             $data[$key][3] = $val['No'];
             $data[$key][4] = $val['Price'];
         }
         // 输出表格
         $pdf->ColoredTable($header, $data);
         //换行
         $pdf->Ln();
     }
     if (!empty($data2)) {
         $html = '<p style="color:#1f76c8;">退货明细:</p>';
         $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
         // 表格标题
         $header = array('时间', '退款方式', '修理厂名称', '退货单号', '支出(元)');
         // 导入数据
         $data = array();
         foreach ($data2 as $key => $val) {
             $data[$key][0] = date('Y-m-d', $val['CreateTime']);
             $data[$key][1] = $val['Payment'] == 1 ? '物流代收款' : '支付宝担保';
             $data[$key][2] = Organ::model()->findByPk($val['BuyerID'], array('select' => 'OrganName'))->attributes['OrganName'];
             $data[$key][3] = $val['No'];
             $data[$key][4] = $val['Price'];
         }
         // 输出表格
         $pdf->ColoredTable($header, $data);
     }
     $pdf->Output('Account.pdf', 'I');
 }
Esempio n. 27
0
/images/help.jpg"></a>
                    </div>
                    <div class="global-toplink float_r">
                        <div class="float_l customer">
                            <?php 
echo Yii::app()->user->getLogTitle();
?>
                        </div>
                        <em>&nbsp;&nbsp;|</em>
                        <!--                        <a href="">登录</a>
                                                <em>|</em>-->

                        <?php 
//只有修理厂登录才会显示由你配
$organID = Yii::app()->user->getOrganID();
$JpdOrgan = Organ::model()->findByPk($organID);
if ($JpdOrgan['Identity'] == 3) {
    ?>
                            <a href="<?php 
    echo Yii::app()->createUrl('pap/home/index');
    ?>
" target=_blank>由你配首页</a>  <em>|</em>
                        <?php 
}
?>

                        <a href="<?php 
echo Yii::app()->createUrl('helpcenter/home/kefu');
?>
">在线客服</a><em>|</em>
                    </div>
Esempio n. 28
0
 public static function sellerstore($orderid)
 {
     return Organ::model()->findByPk($orderid);
 }
Esempio n. 29
0
 public function actionUpdateaddress()
 {
     $id = Yii::app()->user->getOrganID();
     $address = array();
     $address = Organ::model()->findByPk($id)->attributes;
     echo json_encode($address);
 }
Esempio n. 30
0
 /**
  * Performs the pre-action filtering.
  * @param CFilterChain $filterChain the filter chain that the filter is on.
  * @return boolean whether the filtering process should continue and the action should be executed.
  * @throws CHttpException if the user is denied access.
  */
 protected function preFilter($filterChain)
 {
     $itemName = '';
     $controller = $filterChain->controller;
     $action = $filterChain->action;
     /* @var $user CWebUser */
     $user = Yii::app()->getUser();
     //未登陆可访问页面:帮助中心
     $controllerId = strtolower($controller->getId());
     $actionId = strtolower($action->getId());
     if (in_array($controllerId, array('page', 'pay'))) {
         return true;
     }
     //判断用户是否过期
     $ExpirationTime = Yii::app()->user->getExpirationTime();
     if ($ExpirationTime && $ExpirationTime < $_SERVER['REQUEST_TIME']) {
         Yii::app()->user->logout();
     }
     // 是否登录
     if ($user->isGuest) {
         $user->loginRequired();
     }
     //用户配额管理
     $this->operatequota();
     if (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtolower($_SERVER["HTTP_X_REQUESTED_WITH"]) == "xmlhttprequest") {
         return true;
         // ajax 请求的处理方式
     } else {
         //self::updatelasttime();
         //判断机构是否登记
         $organID = Yii::app()->user->getOrganID();
         $organ = Organ::model()->findByPk($organID);
         if ($organ->Status == 0) {
             Yii::app()->controller->redirect(array('/user/activation/index'));
         } else {
             if ($organ->Status == 2) {
                 Yii::app()->controller->redirect(array('/user/activecompany/index'));
             }
         }
         //            $identityorganID = Commonmodel::getAuthOrgan();
         //            if (empty($identityorganID['ID']) || empty($identityorganID['OrganName']) || empty($identityorganID['Phone']) || empty($identityorganID['Email'])) {
         //                if (!($controllerId == 'company' && $actionId == 'index')) {
         //                    Yii::app()->controller->redirect(array("/member/company/index"));
         //                }
         //                if ($identityorganID['Identity'] == 1) {
         ////                Yii::app()->controller->red("//site/nopower");
         //                    if (!($controllerId == 'makecompany' && ($actionId == 'index' || $actionId == 'Savedealerorgan'))) {
         //                        Yii::app()->controller->redirect(array("/maker/makecompany/index"));
         //                    }
         //                } elseif ($identityorganID['Identity'] == 2) {
         //                    if (!($controllerId == 'dealercompany' && ($actionId == 'index' || $actionId == 'Savedealerorgan'))) {
         //                        Yii::app()->controller->redirect(array("/dealer/dealercompany/index"));
         //                    }
         //                } elseif ($identityorganID['Identity'] == 3) {
         //                    if (!($controllerId == 'servicecompany' && ($actionId == 'index' || $actionId == 'Saveserviceorgan'))) {
         //                        Yii::app()->controller->redirect(array("/servicer/servicecompany/index"));
         //                    }
         //                }
         // }
         $route = $controller->getRoute();
         $rootID = F::getroot();
         $activeMenu = FrontMenu::getMenuIDByRoute($route, $rootID);
         //url参数
         $urlparams = $_GET;
         $urlparams = array_filter($urlparams);
         if ($activeMenu) {
             //用户日志
             $infos = $this->recordlog($activeMenu['Name']);
             //MongoDB用户操作详细日志
             $oper = F::getoperation($activeMenu['Url'], $info == null, $urlparams);
             if (($mod = $controller->getModule()) !== null) {
                 $item .= strtolower($mod->getId());
                 $cont = strtolower($controller->getId());
                 $item .= "-" . $cont;
                 if (!in_array($item, array('maker-default', 'dealer-default', 'servicer-default'))) {
                     if (Yii::app()->user->isEmploye() && !Yii::app()->user->checkAccess($activeMenu['ID'])) {
                         Yii::app()->controller->render("//site/nopower");
                         Yii::app()->end();
                     }
                 }
             }
         } else {
             $route = $controller->getRoute();
             $urlparams = $_GET;
             $oper = F::getoperation($route, $info == null, $urlparams);
             if (Yii::app()->user->isEmploye() && !Yii::app()->user->checkAccess($activeMenu['ID'])) {
                 Yii::app()->controller->render("//site/nopower");
                 Yii::app()->end();
             }
             // 正常请求的处理方式
         }
     }
     // Module
     if (($module = $controller->getModule()) !== null) {
         $itemName .= strtolower($module->getId());
         $controllerId = strtolower($controller->getId());
         if (!in_array($itemName, array('maker', 'dealer', 'servicer', 'mall', 'cim'))) {
             return true;
         } else {
             if (Yii::app()->user->isMaker()) {
                 if (in_array($itemName, array('maker'))) {
                     return true;
                 } else {
                     $itemName .= "-" . $controllerId;
                     if (in_array($itemName, array('mall-makeorder', 'cim-contact', 'mall-makecount'))) {
                         return true;
                     }
                     Yii::app()->controller->redirect(array('/maker'));
                 }
             } else {
                 if (Yii::app()->user->isDealer()) {
                     if (in_array($itemName, array('dealer'))) {
                         return true;
                     } else {
                         $itemName .= "-" . $controllerId;
                         if (in_array($itemName, array('mall-order', 'mall-goods', 'mall-quotationbuy', 'mall-quotationsell', 'mall-myaddress', 'mall-querygoods', 'mall-payment', 'mall-quotations', 'mall-sellcount', 'mall-quotationorder', 'mall-sell', 'mall-jporder', 'dealer-makequery', 'cim-businessshare', 'cim-contact', 'cim-pricemanage', 'cim-logistics', 'cim-discountset'))) {
                             return true;
                         }
                         Yii::app()->controller->redirect(array('/dealer'));
                     }
                 } else {
                     if (Yii::app()->user->isServicer()) {
                         if (in_array($itemName, array('servicer'))) {
                             return true;
                         } else {
                             $itemName .= "-" . $controllerId;
                             if (in_array($itemName, array('mall-quotationbuy', 'mall-payment', 'mall-querygoods', 'mall-jporder', 'mall-buy', 'mall-myaddress', 'mall-inquiry', 'mall-quotation', 'cim-contact'))) {
                                 return true;
                             }
                             Yii::app()->controller->redirect(array('/servicer'));
                         }
                     } else {
                         Yii::app()->controller->redirect(array('/site/index'));
                     }
                 }
             }
         }
     }
     return true;
 }