Beispiel #1
0
 public function updateVendorOtherInfo($vendor_desc, $vendor_topImg, $vendor_logoImg)
 {
     $result = false;
     //获取数据库连接
     $conn = DaoBase::_getConn();
     mysql_query("BEGIN");
     //或者mysql_query("START TRANSACTION");
     //获取Session中的vendor
     $vendor = User::_getVendor();
     if ($vendor != null) {
         $infoId = $vendor['vendor_info_id'];
         //更新商家信息
         $data = array("vendor_desc" => $vendor_desc);
         if ($vendor_topImg != null) {
             $data['vendor_adver_loc'] = $vendor_topImg;
         }
         if ($vendor_logoImg != null) {
             $data['vendor_img_loc'] = $vendor_logoImg;
         }
         $where = array("info_id = " => $infoId);
         $dao = new DaoVendorInfo();
         $result = $dao->update($data, $where);
     }
     if ($result) {
         mysql_query("COMMIT");
         //更新session信息
     } else {
         mysql_query("ROLLBACK");
     }
     DaoBase::_closeConn($conn);
     return $result;
 }
Beispiel #2
0
 /**
  * 
  * @param $top 获取的产品个数
  * @param $type 产品类型
  * @return 获取产品信息的基本列表
  * @return 同时获取相应产品的商家名称
  */
 public function getTopProductByType($top, $type)
 {
     $res = array();
     $dao = new DaoProductBasicinfo();
     $res = $dao->getTopBasicinfoByType($top, $type);
     if (!empty($res)) {
         $daoProduct = new DaoProduct();
         $daoVendor = new DaoVendor();
         $daoVendorInfo = new DaoVendorInfo();
         for ($i = 0, $len = count($res); $i < $len; $i++) {
             $res[$i]['vendor_info'] = 0;
             $productId = (int) $res[$i]['product_id'];
             if (!empty($productId)) {
                 $vendorIdList = $daoProduct->getVendorIdByProductId($productId);
                 if (count($vendorIdList) == 1) {
                     $vendor = $daoVendor->getVendorById((int) $vendorIdList[0]);
                     if (!empty($vendor) && ($info_id = $vendor[0]['vendor_info_id']) != null) {
                         $vendor_info = $daoVendorInfo->getVendorInfoById((int) $info_id);
                         if (count($vendor_info) == 1) {
                             $res[$i]['vendor_info'] = $vendor_info[0];
                         }
                     }
                 }
             }
         }
     }
     return $res;
 }
Beispiel #3
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;
 }