Beispiel #1
0
 static function editExtData($objid, $model_id, $data)
 {
     if (!self::checkCustom($model_id)) {
         return false;
     }
     $extCode = CustomClass::getExtCodeByModelId($model_id);
     if ($data) {
         foreach ($data as $k => $v) {
             if (in_array($k, $extCode)) {
                 $fieldInfo = self::getFieldName($k);
                 $extData = array();
                 $extData[$k]['fieldname'] = $fieldInfo['f_name'];
                 $extData[$k]['content'] = kekezu::escape($v);
                 $jsondata = serialize($extData);
                 $sql = "UPDATE " . TABLEPRE . "witkey_custom_fields_ext SET extdata='{$jsondata}' WHERE objid='{$objid}' AND model_id ='{$model_id}' AND c_id = '{$fieldInfo['id']}' ";
                 db_factory::execute($sql);
             }
         }
     }
 }
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
$objTable = keke_table_class::get_instance("witkey_custom_fields");
intval($page) or $page = 1;
$url = "index.php?do=custom&view=fields&model_id={$model_id}&page={$page}";
$id = intval($id);
$model_id = intval($model_id);
if ($opajax == 'setorder') {
    db_factory::execute("UPDATE `" . TABLEPRE . "witkey_custom_fields` SET `listorder`='" . intval($ordernum) . "' WHERE (`id`='" . $id . "')");
    die;
}
if ($opajax == 'setopen') {
    db_factory::execute("UPDATE `" . TABLEPRE . "witkey_model` SET `open_custom`='" . intval($opennum) . "' WHERE (`model_id`='" . $model_id . "')");
    die;
}
if ($ac == 'del') {
    CustomClass::delExtData($id);
    $res = $objTable->del('id', $id);
    $res and kekezu::admin_show_msg($_lang['delete_success'], $url, 3, '', 'success') or kekezu::admin_show_msg($_lang['delete_fail'], $url, 3, '', 'warning');
} else {
    $where = " 1 = 1 and model_id = " . $model_id;
    $where .= " order by listorder asc ";
    $d = $objTable->get_grid($where, $url, $page, 10, null, 1, 'ajax_dom');
    $dataList = $d['data'];
    $pages = $d['pages'];
}
require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_' . $do . '_' . $view);
Beispiel #3
0
if ($op == 'basic') {
    $service_obj = new service_shop_class();
    $service_info = db_factory::get_one(sprintf("select * from %switkey_service where service_id='%d'", TABLEPRE, $service_id));
    if ($service_info['pic']) {
        $servicePics = explode(',', $service_info['pic']);
    }
    if ($service_info['file_path']) {
        $serviceFiles = explode(',', $service_info['file_path']);
    }
    $ac_url = "index.php?do=model&model_id=7&view=edit&service_id=" . $service_id;
    $status_arr = $service_obj->get_service_status();
    unset($status_arr[1]);
    $service_info['ext_fields'] = CustomClass::getExtDataList($service_info['service_id'], $service_info['model_id']);
    if ($sbt_edit) {
        if ($ext_fds) {
            CustomClass::editExtData($service_id, $model_id, $ext_fds);
        }
        kekezu::admin_system_log($_lang['to_witkey_service_name_is'] . $service_info[title] . $_lang['in_edit_operate']);
        service_shop_class::set_on_sale_num($pk['service_id'], $fds['service_status']);
        $service_obj = keke_table_class::get_instance('witkey_service');
        $c = $service['content'];
        $fds = kekezu::escape($service);
        $service['content'] = $c;
        isset($service['is_top']) or $service['is_top'] = 0;
        $service_obj->save($service, array("service_id" => $service_id));
        kekezu::admin_show_msg($_lang['service_edit_success'], 'index.php?do=model&model_id=7&view=list', 2, $_lang['service_edit_success'], 'success');
    }
} else {
    require S_ROOT . '/shop/' . $model_info['model_dir'] . '/admin/shop_misc.php';
}
require keke_tpl_class::template('shop/' . $model_info['model_dir'] . '/admin/tpl/service_edit_' . $op);
Beispiel #4
0
defined('ADMIN_KEKE') or exit('Access Denied');
intval($task_id) or kekezu::admin_show_msg($_lang['param_error'], 'index.php?do=model&model_id=' . $model_id . '&view=list', 3, '', 'warning');
$ops = array('basic', 'work', 'comm');
in_array($op, $ops) or $op = 'basic';
$task_info = db_factory::get_one(sprintf(" select * from %switkey_task where task_id='%d'", TABLEPRE, $task_id));
$task_config = unserialize($model_info['config']);
keke_lang_class::loadlang('task_edit', 'task');
$task_sub_time = date('Y-m-d', $task_info['sub_time']);
$task_end_time = date('Y-m-d', $task_info['end_time']);
$task_start_time = date('Y-m-d', $task_info['start_time']);
if ($op == 'basic') {
    $cash_rule_arr = kekezu::get_table_data("*", "witkey_task_cash_cove", "model_code='{$model_info['model_code']}'", "", '', '', "cash_rule_id");
    $task_info['ext_fields'] = CustomClass::getExtDataList($task_id, $task_info['model_id']);
    if ($sbt_edit) {
        if ($ext_fds) {
            CustomClass::editExtData($task_id, $model_id, $ext_fds);
        }
        $task_obj = new Keke_witkey_task_class();
        $task_obj->setWhere(" task_id ='{$task_id}'");
        $task_obj->setTask_title(kekezu::escape($task_title));
        if ($txt_task_day) {
            $task_obj->setSub_time(strtotime($txt_task_day));
            $task_obj->setEnd_time(strtotime($txt_task_day) + $task_config['choose_time'] * 24 * 3600);
        }
        $task_obj->setIndus_id($slt_indus_id);
        $task_obj->setTask_cash($task_cash);
        $task_obj->setReal_cash($task_cash * (1 - $task_info['profit_rate'] / 100));
        $fds['task_cash_coverage'] and $task_obj->setTask_cash_coverage($fds['task_cash_coverage']);
        $fds['budget'] and $task_obj->setBudget($fds['budget']);
        $task_obj->setTask_desc($task_desc);
        $fields = kekezu::escape($fields);
Beispiel #5
0
 public static function service_del($service_ids)
 {
     if (is_array($service_ids)) {
         foreach ($service_ids as $v) {
             $info = db_factory::get_one(sprintf("select * from %switkey_service where service_id='%d' ", TABLEPRE, intval($v)));
             if ($info) {
                 CustomClass::delExtDataByObjId($info['service_id'], $info['model_id']);
             }
         }
         $ids = implode(",", $service_ids) or $ids = $service_ids;
     } else {
         $ids = $service_ids;
         $info = db_factory::get_one(sprintf("select * from %switkey_service where service_id='%d' ", TABLEPRE, $ids));
         if ($info) {
             CustomClass::delExtDataByObjId($info['service_id'], $info['model_id']);
         }
     }
     db_factory::execute(sprintf("DELETE FROM %switkey_feed where feedtype in('pub_service','service') and obj_id in(%s)", TABLEPRE, $ids));
     return db_factory::execute(sprintf("DELETE FROM %switkey_service where service_id in(%s)", TABLEPRE, $ids));
 }
 public function update_service_info($service_id, $obj_name)
 {
     global $_K;
     global $_lang, $uid, $username;
     $std_obj = $this->_std_obj;
     $release_info = $std_obj->_release_info;
     $user_info = $this->_user_info;
     $service_obj = $this->_service_obj;
     if ($service_id) {
         $service_status = $service_obj->getService_status();
         $service_title = $service_obj->getTitle();
         $service_cash = $service_obj->getPrice();
         switch ($service_status) {
             case "2":
                 $feed_arr = array("feed_username" => array("content" => $this->_username, "url" => "index.php?do=seller&id={$this->_uid}"), "action" => array("content" => $_lang['has_pub_goods'], "url" => ""), "event" => array("content" => "{$service_title}", "url" => "index.php?do=goods&id={$service_id}", "cash" => $service_cash, "model_id" => "{$this->_model_id}"));
                 kekezu::save_feed($feed_arr, $this->_uid, $this->_username, 'pub_service', $service_id);
                 db_factory::execute(' update ' . TABLEPRE . 'witkey_shop set on_sale=on_sale+1 where shop_id=' . $service_obj->getShop_id());
                 break;
             case "1":
                 break;
         }
         CustomClass::createExtData($service_id, $this->_model_id, $release_info);
         if (!empty($release_info['payitem'])) {
             $orderId = $this->createPayitemOrder($service_id, $release_info['payitem']);
             kekezu::show_msg('该商品的增值服务需要支付!', "index.php?do=pubgoods&id=" . $service_obj->_model_id . "&serviceId=" . $service_id . "&step=step4&orderId=" . $orderId, 3, null, 'ok');
         } else {
             $this->del_service_obj($obj_name);
             kekezu::show_msg('订单付款完成,该订单已确认付款', "index.php?do=pubgoods&id=" . $service_obj->_model_id . "&serviceId=" . $service_id . "&step=step3", 3, null, 'ok');
         }
         $this->notify_user($service_id, $service_status);
     }
 }
Beispiel #7
0
            case "recommend":
                //推荐
                $res = keke_task_config::task_recommend($task_id);
                break;
            case "unrecommend":
                //取消推荐
                $res = keke_task_config::task_unrecommend($task_id);
                break;
            case "del":
                //删除
                $res = keke_task_config::task_del($task_id);
        }
    } else {
        $process_arr = keke_task_config::can_operate($task_info['task_status'], $task_info['is_top']);
        $file_list = db_factory::query(sprintf(" select * from %switkey_file where task_id='%d'  and obj_type='task' ", TABLEPRE, $task_id));
        $status_arr = sreward_task_class::get_task_status();
        $payitem_list = keke_payitem_class::get_payitem_config('employer');
        $indus_arr = $kekezu->_indus_arr;
        $temp_arr = array();
        $indus_option_arr = $indus_arr;
        kekezu::get_tree($indus_option_arr, $temp_arr, "option", $task_info['indus_id']);
        $indus_option_arr = $temp_arr;
    }
    $task_info['ext_fields'] = CustomClass::getExtDataList($task_id, $task_info['model_id']);
    if ($res) {
        kekezu::admin_show_msg($_lang['task_operate_successfully'], "index.php?do=model&model_id={$model_id}&view=list", 3, '', 'success');
    }
} else {
    require S_ROOT . '/task/' . $model_info['model_dir'] . '/admin/task_misc.php';
}
require $kekezu->_tpl_obj->template('task/' . $model_info['model_dir'] . '/admin/tpl/task_edit_' . $op);
Beispiel #8
0
    if ($arrOrderInfo['order_status'] == 'ok') {
        $boolIsHosting = true;
    } else {
        $boolIsHosting = false;
    }
    $arrSimpleTasks = db_factory::query("select * from " . TABLEPRE . "witkey_task where indus_pid=" . $arrTaskInfo['indus_pid'] . " and task_id!=" . $arrTaskInfo['task_id'] . " and task_status not in(0,1,10) order by start_time desc limit 10");
    $arrRecommShops = db_factory::query(sprintf("select a.username,a.uid,b.indus_id,b.indus_pid,a.shop_name,if(b.seller_total_num>0,b.seller_good_num/b.seller_total_num,0) as good_rate from %switkey_shop a " . " left join %switkey_space b on a.uid=b.uid  where b.recommend=1 and b.status=1 and IFNULL(a.is_close,0)=0 and shop_status=1 order by if(b.indus_pid=%d ,1,0) desc, good_rate desc limit 0,5", TABLEPRE, TABLEPRE, $arrTaskInfo['indus_pid']), 1, $intIndexCacheTime);
    if ($view == 'mark') {
        $s === null and $s = 100 or $s = intval($s);
        $arrSearchStatus = array();
        $arrSearchStatus['100'] = '所有的';
        $arrSearchStatus['1'] = '好评';
        $arrSearchStatus['2'] = '中评';
        $arrSearchStatus['3'] = '差评';
        $arrSearchStatus['101'] = '来自雇主';
        $arrSearchStatus['102'] = '来自威客';
    }
    if ($arrModelInfo['open_custom'] == '1') {
        $c_open = 1;
        $arrShowCustoms = CustomClass::getExtData($arrTaskInfo['task_id'], $arrModelInfo['model_id']);
        foreach ($arrShowCustoms as $k => $v) {
            if ($v['extdata']) {
                $arrShowCustoms[$k]['data'] = unserialize($v['extdata']);
            }
        }
    }
    require S_ROOT . "/task/" . $arrModelInfo['model_dir'] . "/control/index.php";
    $_SESSION['spread'] = 'index.php?do=task&id=' . intval($id);
    require keke_tpl_class::template("task/" . $arrModelInfo['model_code'] . "/tpl/" . $_K['template'] . "/index");
    die;
}
Beispiel #9
0
 public static function del_sign_task($task_id, $model)
 {
     global $_lang;
     $taskInfo = db_factory::get_one(sprintf("select * from %switkey_task where task_id='%d' and task_status in(0,1,8,9,10)", TABLEPRE, $task_id));
     if ($taskInfo) {
         CustomClass::delExtDataByObjId($taskInfo['task_id'], $taskInfo['model_id']);
     }
     if ($model === 1) {
         $sql = sprintf("delete from %switkey_task_work where task_id='%d'", TABLEPRE, $task_id);
     } else {
         $sql = sprintf("delete from %switkey_task_bid where task_id ='%d'", TABLEPRE, $task_id);
     }
     db_factory::execute($sql);
     $file_sql = sprintf("select save_name from %switkey_file where task_id = '%d' ", TABLEPRE, $task_id);
     $files = db_factory::query($file_sql);
     foreach ($files as $v) {
         keke_file_class::del_file($v['save_name']);
     }
     db_factory::execute(sprintf("delete from %switkey_file where task_id ='%d' ", TABLEPRE, $task_id));
     $del_title = db_factory::get_count(sprintf("select task_title from %switkey_task where task_id='%d'", TABLEPRE, $task_id));
     kekezu::admin_system_log($_lang['delete_task'] . ":{$del_title}");
 }
Beispiel #10
0
$arrPayitemLists = PayitemClass::getPayitemListForPub();
$arrPayitemPriceLists = PayitemClass::getPayitemPriceList();
$arrDistribution = array(1 => '单人中标', 2 => '多人中标', 3 => '', 4 => '单人中标', 5 => '单人中标', 12 => '单人中标');
$arrTopIndustrys = $kekezu->_indus_task_arr;
$arrModelLists = kekezu::get_table_data('*', 'witkey_model', " model_type = 'task' and model_status='1'", 'listorder asc ', '', '', 'model_id', 3600);
if (0 === $id) {
    $arrModelIds = array_keys($arrModelLists);
    $id = $arrModelIds['0'];
}
$arrModelInfo = $arrModelLists[$id];
if (empty($arrModelInfo)) {
    kekezu::show_msg('不存在该任务模型,请重新选择', 'index.php?do=pubtask', 3, null, 'warning');
}
$arrStep = array('step1', 'step2', 'step3', 'step4');
if (!in_array($step, $arrStep)) {
    $step = 'step1';
}
$strUrl = "index.php?do=pubtask&id=" . $id;
$arrOutFinance = db_factory::query(sprintf("select * from %switkey_finance where fina_type='out' and obj_id='%d' and uid='%d'", TABLEPRE, $taskId, $gUid));
if ($arrOutFinance) {
    $isReturn = 2;
}
if ($arrModelInfo['open_custom'] == '1') {
    $c_open = 1;
    $arrCustoms = CustomClass::getFieldListsByModelId($arrModelInfo['model_id']);
}
$arrProvinces = CommonClass::getDistrictByPid('0', 'id,upid,name');
$gUserInfo['province'] and $arrCities = CommonClass::getDistrictByPid($gUserInfo['province'], 'id,upid,name');
$gUserInfo['city'] and $arrAreas = CommonClass::getDistrictByPid($gUserInfo['city'], 'id,upid,name');
$_SESSION['spread'] = 'index.php?do=pubtask';
require S_ROOT . "/task/" . $arrModelInfo['model_dir'] . "/control/pub.php";
    }
    if ($length_limit) {
        $arrlen = getLength($length_limit);
        $fds['f_min_len'] = intval($arrlen['min']);
        $fds['f_max_len'] = intval($arrlen['max']);
        $fds['f_fixed_len'] = intval($arrlen['fixed']);
    }
    $fds['f_type'] = 'varchar';
    if (!$id) {
        $fds['f_code'] = $tbfield;
    }
    $fds['model_id'] = $model_id;
    $objTable = keke_table_class::get_instance("witkey_custom_fields");
    $result = $objTable->save($fds, array('id' => $id));
    if ($result) {
        CustomClass::updateExtData($id);
    }
    kekezu::admin_show_msg('操作成功', $url, 3, '', 'success');
} else {
    $arrInfo = db_factory::get_one("SELECT * FROM `" . TABLEPRE . "witkey_custom_fields` where id = '" . intval($id) . "' and model_id = " . intval($model_id));
}
if ($check_f_name) {
    if (!checkFieldName($check_f_name, $model_id)) {
        echo 1;
    } else {
        echo '字段名已存在';
    }
    die;
}
function getCusFieldsMaxId()
{
 public function update_task_info($task_id, $obj_name)
 {
     global $_K, $_lang, $uid, $username;
     $std_obj = $this->_std_obj;
     $release_info = $std_obj->_release_info;
     $att_info = $release_info['payitem'];
     $user_info = $this->_user_info;
     $task_obj = $this->_task_obj;
     db_factory::execute("update " . TABLEPRE . "witkey_space set pub_num = pub_num+1 where uid={$this->_uid} ");
     $release_info['file_ids'] and $this->save_task_file($task_id, $release_info['txt_title']);
     $task_status = $task_obj->getTask_status();
     $task_title = $task_obj->getTask_title();
     if (in_array($this->_model_info['model_code'], array('sreward', 'mreward', 'preward'))) {
         $task_cash = $task_obj->getTask_cash();
     } else {
         $task_cash = $task_obj->getTask_cash_coverage();
     }
     $order_id = $this->create_task_order($task_id, $this->_model_id, $release_info, 'wait');
     if (floatval($release_info['hdn_total_costs']) >= 0) {
         $this->createPayitemOrder($task_id, $release_info['payitem'], $order_id);
     }
     if ($this->_model_id != 5) {
         $this->create_prom_event($task_id);
     }
     CustomClass::createExtData($task_id, $this->_model_id, $release_info);
     $this->del_task_obj($obj_name);
 }
Beispiel #13
0
    }
    $arrBreadcrumbs = array(1 => array('url' => 'index.php?do=goodslist', 'name' => '威客商城'), 2 => array('url' => 'index.php?do=goodslist&pd=' . $arrServiceInfo['indus_pid'], 'name' => $indus_p_arr[$arrServiceInfo['indus_pid']]['indus_name']), 3 => array('url' => 'index.php?do=goodslist&pd=' . $arrServiceInfo['indus_pid'] . '&i=' . $arrServiceInfo['indus_id'], 'name' => $indus_arr[$arrServiceInfo['indus_id']]['indus_name']));
    $arrCoverList = keke_shop_class::output_pics($arrServiceInfo['pic'], '');
    $intNum = sizeof($arrCoverList);
    $mc = keke_shop_class::get_mark_count_ext($model_list[$arrServiceInfo['model_id']]['model_code'], $intId);
    $mc['all'] = intval($mc[1]['c'] + $mc[2]['c']);
    $mc['seller'] = intval($mc[1]['c']);
    $mc['buyer'] = intval($mc[2]['c']);
    $arrOwnerInfo = kekezu::get_user_info($arrServiceInfo['uid']);
    $strAddress = keke_shop_class::getUserAddress($arrServiceInfo['uid'], 2, 1, 1, 0);
    $strUserLevel = unserialize($arrOwnerInfo['seller_level']);
    $arrAuthItems = keke_auth_fac_class::getAuthItemListByUid($arrOwnerInfo['uid']);
    $arrShopAid = keke_user_mark_class::get_user_aid($arrOwnerInfo['uid'], 2, null, 1);
    $arrOtherGoods = db_factory::query("select * from " . TABLEPRE . "witkey_service where uid=" . intval($arrOwnerInfo['uid']) . " and service_id!='" . $arrServiceInfo['service_id'] . "' and service_status=2 order by on_time desc limit 3");
    $arrPayitemLists = PayitemClass::getPayitemListDetail('goods', $arrServiceInfo['service_id']);
    $arrPayitemShow = keke_shop_class::getPayitemShow($arrServiceInfo);
    $arrRecommShops = db_factory::query(sprintf("select a.username,a.uid,b.indus_id,b.indus_pid,a.shop_name,if(b.seller_total_num>0,b.seller_good_num/b.seller_total_num,0) as good_rate from %switkey_shop a " . " left join %switkey_space b on a.uid=b.uid  where b.recommend=1 and b.status=1 and IFNULL(a.is_close,0)=0 and shop_status=1 order by if(b.indus_pid=%d ,1,0) desc, good_rate desc limit 0,5", TABLEPRE, TABLEPRE, $arrServiceInfo['indus_pid']), 1, $intIndexCacheTime);
    if ($arrModelInfo['open_custom'] == '1') {
        $c_open = 1;
        $arrShowCustoms = CustomClass::getExtData($arrServiceInfo['service_id'], $arrModelInfo['model_id']);
        foreach ($arrShowCustoms as $k => $v) {
            if ($v['extdata']) {
                $arrShowCustoms[$k]['data'] = unserialize($v['extdata']);
            }
        }
    }
    require S_ROOT . "/shop/" . $arrModelInfo['model_dir'] . "/control/index.php";
    require keke_tpl_class::template("shop/" . $arrModelInfo['model_code'] . "/tpl/" . $_K['template'] . "/index");
    die;
}
$_SESSION['spread'] = 'index.php?do=goods&id=' . intval($id);
Beispiel #14
0
 /**
  * Instantiate a class instance based on the given configuration.
  *
  * @param array $config The configuration array
  *
  * @return BuiltinClass|CustomClass
  */
 protected function instantiateClass(array $config)
 {
     if (in_array($config['name'], BuiltinClass::$classNames, true)) {
         $class = new BuiltinClass();
     } else {
         $class = new CustomClass();
     }
     $class->setDatabase($this->database);
     $class->setData($config);
     return $class;
 }