Exemplo n.º 1
0
 /**
  * 功能:通过采购员的id获取名字
  * @param str $id
  * @return void
  * @author wxb
  * @date 2013/11/8
  */
 public static function purchaseNameById($id)
 {
     if (empty($id)) {
         self::$errCode = "0312";
         self::$errMsg = "id empty";
         return false;
     }
     self::initDB();
     $sql = "SELECT global_user_name  FROM " . self::$usertab;
     $sql .= "  WHERE global_user_is_delete =0 AND global_user_status = 1  AND  global_user_id = {$id}   LIMIT 1";
     $query = self::$dbConn->query($sql);
     if ($query) {
         $ret = self::$dbConn->fetch_array($query);
         return $ret['global_user_name'];
     } else {
         self::$errCode = "0338";
         self::$errMsg = "mysql:" . $sql . " error";
         return false;
     }
 }
Exemplo n.º 2
0
 public static function getMaterInfo()
 {
     global $memc_obj;
     $cacheName = md5("om_pmInfo");
     $list = $memc_obj->get_extral($cacheName);
     if ($list) {
         return $list;
     } else {
         require_once WEB_PATH . "api/include/functions.php";
         $url = 'http://gw.open.valsun.cn:88/router/rest?';
         $paramArr = array('method' => 'pc.getPmInfoAll', 'format' => 'json', 'v' => '1.0', 'username' => 'purchase');
         $result = callOpenSystem($paramArr);
         $data = json_decode($result, true);
         if (!$data['data']) {
             self::$errCode = 101;
             self::$errMsg = "没取到值!";
             return false;
         } else {
             $isok = $memc_obj->set_extral($cacheName, $data['data']);
             if (!$isok) {
                 self::$errCode = 102;
                 self::$errMsg = 'memcache缓存账号信息出错!';
                 return $data['data'];
             }
             return $data['data'];
         }
     }
 }
Exemplo n.º 3
0
 public static function getPropertyRelationList($id)
 {
     self::initDB();
     $sql = "SELECT a.propertyId,b.propertyName FROM pc_goods_property_relation AS a \n\t\t\t\t  LEFT JOIN pc_goods_property as b on a.propertyId=b.id WHERE a.goodsId='{$id}'";
     $query = self::$dbConn->query($sql);
     if ($query) {
         $ret = self::$dbConn->fetch_array_all($query);
         return $ret;
     } else {
         self::$errCode = "003";
         self::$errMsg = "444444444";
         return false;
     }
 }