Ejemplo n.º 1
0
 /**
  *  更新身份认证信息
  * @param 文件路径信息 $filePath
  * @return boolean
  */
 public function saveIdenAuth($filePath)
 {
     $result = false;
     //获取数据库连接
     $conn = DaoBase::_getConn();
     mysql_query("BEGIN");
     //或者mysql_query("START TRANSACTION");
     //获取Session中的vendor
     $vendor = User::_getVendor();
     if ($vendor != null) {
         $idenId = $vendor['vendor_iden_id'];
         //获取这个验证信息,判断验证信息的状态是否合法
         if ($idenId != null) {
             $dao = new DaoVendorAuth();
             $iden = $dao->getVendorAuthById($idenId);
             if (count($iden) == 1 && ($iden[0]['auth_ispass'] == 1 || $iden[0]['auth_ispass'] == 4)) {
                 //更新保存验证信息
                 $dao = new DaoVendorAuth();
                 $resAuth = $dao->updateTransaction($conn, array("auth_license_loc" => $filePath, "auth_ispass" => 2), array("auth_id =" => $idenId));
                 if ($resAuth) {
                     $result = true;
                 }
             }
         }
     }
     if ($result) {
         mysql_query("COMMIT");
     } else {
         mysql_query("ROLLBACK");
     }
     DaoBase::_closeConn($conn);
     return $result;
 }
Ejemplo n.º 2
0
 /**
  * 获取产品基本信息列表
  * @param $pageNumber 页码
  * @param $pageSize 一页放产品的数量
  * @param $keyword 关键字
  */
 public function getVendorList($pageNumber, $pageSize, $keyword)
 {
     $dao = new DaoVendor();
     $vendorList = $dao->getVendorList($pageNumber, $pageSize, $keyword);
     if (!empty($vendorList)) {
         for ($i = 0, $len = count($vendorList); $i < $len; $i++) {
             $certiId = $vendorList[$i]['vendor_certi_id'];
             $infoId = $vendorList[$i]['vendor_info_id'];
             if (!empty($certiId)) {
                 $daoVendorAuth = new DaoVendorAuth();
                 $vendorList[$i]['vendorAuth'] = $daoVendorAuth->getVendorAuthById($certiId);
             } else {
                 $vendorList[$i]['vendorAuth'] = 0;
             }
             //获取商家基本信息
             if (!empty($infoId)) {
                 $daoVendorInfo = new DaoVendorInfo();
                 $vendorList[$i]['vendorInfo'] = $daoVendorInfo->getVendorInfoById($infoId);
             } else {
                 $vendorList[$i]['vendorInfo'] = 0;
             }
         }
     }
     return $vendorList;
 }