/** * 获得商品管理列表 */ public static function getProductList($params) { $options = array('num' => 10, 'code' => false, 'cateId' => false, 'canByScore' => false); if (is_array($params)) { $options = array_merge($options, $params); } extract($options); $whereSql = ''; if ($code) { $whereSql .= "and code = '{$code}' "; } if ($cateId) { $whereSql .= "and cateId = '{$cateId}' "; } if ($canByScore) { $whereSql .= "and canByScore = {$canByScore} "; } $data = Helper_Dao::getRows(array('dbName' => 'Db_Andyou', 'tblName' => 'product', 'cols' => '*', 'limit' => $num, 'whereSql' => $whereSql)); //对报价的处理 if ($data) { foreach ($data as $k => $v) { $data[$k]['oprice'] = $v["price"]; //保存实际的价格 $data[$k]['price'] = $v["price"] / 100; //保存实际的价格 $data[$k]['oinPrice'] = $v["inPrice"]; //保存实际的价格 $data[$k]['inPrice'] = $v["inPrice"] / 100; //保存实际的价格 } } return $data; }
/** * 获得管理员管理列表 */ public static function getAdminUserList($params) { $options = array('num' => 10); if (is_array($params)) { $options = array_merge($options, $params); } extract($options); $whereSql = ''; $data = Helper_Dao::getRows(array('dbName' => 'Db_AndyouYun', 'tblName' => 'yun_adminuser', 'cols' => 'id id,userId userId,passwd passwd,isAdmin isAdmin', 'limit' => $num, 'whereSql' => $whereSql)); return $data; }
/** * 获得所有配置数组 */ public static function getAllOptions() { $data = Helper_Dao::getRows(array('dbName' => 'Db_Andyou', 'tblName' => 'options', 'cols' => '*')); $outArr = array(); if ($data) { foreach ($data as $d) { $d["value"] = $d["isInt"] ? (int) $d["value"] : $d["value"]; $outArr[$d["name"]] = $d; } } return $outArr; }
/** * 获得员工分类管理列表 */ public static function getStaffCateList($params) { $options = array('num' => 10, 'name' => false); if (is_array($params)) { $options = array_merge($options, $params); } extract($options); $whereSql = ''; if ($name) { $whereSql .= "and name = '{$name}' "; } $data = Helper_Dao::getRows(array('dbName' => 'Db_Andyou', 'tblName' => 'staffcate', 'cols' => 'id id,name name,salary salary,percentage percentage', 'limit' => $num, 'whereSql' => $whereSql)); return $data; }
/** * ajax获得指定数据 */ public function doAjaxData(ZOL_Request $input, ZOL_Response $output) { $id = (int) $input->get('id'); $arr = Helper_Dao::getRows(array('dbName' => "Db_Andyou", 'tblName' => "staffcate", 'cols' => "*", 'whereSql' => ' and id=' . $id)); $data = ZOL_String::convToU8($arr); if (isset($data[0])) { echo json_encode($data[0]); } exit; }
/** * 获得日志列表 */ public static function getList($paramArr) { $options = array('appName' => '', 'subId' => 0, 'objId' => 0, 'num' => 10, 'offset' => '', 'getNum' => 0, 'whereSql' => ""); if (is_array($paramArr)) { $options = array_merge($options, $paramArr); } extract($options); $idMap = ZOL_Config::get("Star/InnerApp", "ID"); #顶级的分类 if (!isset($idMap[$appName])) { return false; } $subIdMap = ZOL_Config::get("Star/InnerApp", "SUBID"); #二级的分类 #将subid从英文形式转换为数字 if (isset($subIdMap[$appName]) && isset($subIdMap[$appName][$subId])) { $subId = $subIdMap[$appName][$subId]["id"]; } if ($appName) { $whereSql .= " and appId = " . $idMap[$appName]["id"]; } if ($subId) { $whereSql .= " and subId = " . $subId; } if ($objId) { $whereSql .= " and objId = '" . $objId . "'"; } $res = Helper_Dao::getRows(array('dbName' => "Db_Star", 'tblName' => "log_operations", 'offset' => $offset, 'limit' => $num, 'whereSql' => $whereSql . " order by id desc ", 'debug' => 0)); if ($getNum) { #是否获得数量 $cnt = Helper_Dao::getCount(array('dbName' => "Db_Star", 'tblName' => "log_operations", 'whereSql' => $whereSql, 'debug' => 0)); return array('allNum' => $cnt, 'data' => $res); } return $res; }
/** * ajax获得指定数据 */ public function doAjaxData(ZOL_Request $input, ZOL_Response $output) { $id = (int) $input->get('id'); $arr = Helper_Dao::getRows(array('dbName' => "Db_Andyou", 'tblName' => "membercate", 'cols' => "*", 'whereSql' => ' and id=' . $id)); //数据补充 if ($arr) { foreach ($arr as $k => $v) { if ($v["discountStr"]) { $tmparr = json_decode($v["discountStr"], true); foreach ($tmparr as $i => $iv) { $arr[$k]["disc_" . $i] = $iv; } } } } $data = ZOL_String::convToU8($arr); if (isset($data[0])) { echo json_encode($data[0]); } exit; }
/** * 网站内链资讯手工导入恒星 */ public static function getSeoModuleSyncStar($paramArr) { $options = array('typeId' => '', 'moduleId' => '', 'mode' => 1, 'configArr' => array()); if (is_array($paramArr)) { $options = array_merge($options, $paramArr); } extract($options); if (!$mode) { return false; } if ($mode == 1) { if (empty($configArr)) { return false; } #如果是导产品库,一定要手工和位置类型对应数组 } $whereSql = ' AND d.status=0 '; if ($typeId) { $whereSql .= ' AND m.type_id in(' . $typeId . ') '; } if ($moduleId) { $whereSql .= ' AND m.module_id in(' . $moduleId . ') '; } $tempModuleList = Helper_Dao::getRows(array('dbName' => "Db_Document", 'tblName' => " template_module_class m left join template_module_data d on m.module_id=d.module_id ", 'cols' => "m.module_name,d.title,d.url,d.date", 'whereSql' => $whereSql)); if (empty($tempModuleList)) { return false; } foreach ($tempModuleList as $val) { $nameArr = explode('#', $val['module_name']); if (empty($nameArr[1]) || empty($nameArr[2])) { continue; } if (empty($configArr[$nameArr[1]])) { continue; } $insertArr = array('title' => $val['title'], 'subId' => $nameArr[2], 'url' => $val['url'], 'addTime' => strtotime($val['date']), 'startTime' => strtotime($val['date']), 'endTime' => strtotime('2014-12-31 23:59:59'), 'areaId' => $configArr[$nameArr[1]], 'objId' => $mode); Helper_Dao::insertItem(array('addItem' => $insertArr, 'dbName' => 'Db_Star', 'tblName' => 'seo_weblink_list')); } return true; }
/** * 获得会员分类管理列表 */ public static function getMemberCateList($params) { $options = array('num' => 10, 'name' => false); if (is_array($params)) { $options = array_merge($options, $params); } extract($options); $whereSql = ''; if ($name) { $whereSql .= "and name = '{$name}' "; } $data = Helper_Dao::getRows(array('dbName' => 'Db_AndyouYun', 'tblName' => 'membercate', 'cols' => '*', 'limit' => $num, 'whereSql' => $whereSql)); return $data; }
/** * 获得订单明细管理列表 */ public static function getBillsItemList($params) { $options = array('num' => 10, 'bid' => false, 'bno' => false, 'proId' => false, 'staffid' => false, 'memberId' => false); if (is_array($params)) { $options = array_merge($options, $params); } extract($options); $whereSql = ''; if ($bid) { $whereSql .= "and bid = '{$bid}' "; } if ($bno) { $whereSql .= "and bno = '{$bno}' "; } if ($proId) { $whereSql .= "and proId = '{$proId}' "; } if ($staffid) { $whereSql .= "and staffid = '{$staffid}' "; } if ($memberId) { $whereSql .= "and memberId = '{$memberId}' "; } $data = Helper_Dao::getRows(array('dbName' => 'Db_Andyou', 'tblName' => 'billsItem', 'cols' => 'id id,bid bid,bno bno,proId proId,num num,discount discount,price price,staffid staffid,memberId memberId,tm tm', 'limit' => $num, 'whereSql' => $whereSql)); return $data; }