コード例 #1
0
 public static function set_service_status($service_id, $service_status)
 {
     self::set_on_sale_num($service_id, $service_status);
     $service_obj = new Keke_witkey_service_class();
     if (is_array($service_id)) {
         $service_arr = implode(',', array_unique($service_id));
         $service_obj->setWhere('service_id in(' . $service_arr . ')');
     } else {
         $service_obj->setWhere('service_id=' . $service_id);
     }
     $service_obj->setService_status($service_status);
     $res = $service_obj->edit_keke_witkey_service();
     if ($res && $service_status) {
         if (is_array($service_id)) {
             foreach ($service_id as $key => $val) {
                 $service_info = keke_shop_class::get_service_info($val);
                 $feed_arr = array("feed_username" => array("content" => $service_info['username'], "url" => "index.php?do=seller&id=" . $service_info['uid']), "action" => array("content" => '发布了文件', "url" => ""), "event" => array("content" => "{$service_info['title']}", "url" => "index.php?do=goods&id={$val}", "cash" => "{$service_info['price']}", "model_id" => "{$service_info['model_id']}"));
                 kekezu::save_feed($feed_arr, $service_info['uid'], $service_info['username'], 'pub_service', $val);
                 PayitemClass::updateTopitem($service_info['service_id'], 'goods');
             }
         } else {
             $service_info = keke_shop_class::get_service_info($service_id);
             $feed_arr = array("feed_username" => array("content" => "{$service_info['username']}", "url" => "index.php?do=seller&id={$service_info['uid']}"), "action" => array("content" => '发布作品', "url" => ""), "event" => array("content" => "{$service_info['title']}", "url" => "index.php?do=goods&id={$service_id}", "cash" => "{$service_info['price']}", "model_id" => "{$service_info['model_id']}"));
             kekezu::save_feed($feed_arr, $service_info['uid'], $service_info['username'], 'pub_service', $service_id);
             PayitemClass::updateTopitem($service_id, 'goods');
         }
     }
     return $res;
 }
コード例 #2
0
 function service_pass($service_ids)
 {
     is_array($service_ids) and $ids = implode(",", $service_ids) or $ids = $service_ids;
     $ids and self::set_on_sale_num($ids, 2);
     $res = db_factory::execute(sprintf("update %switkey_service set service_status='%d'  where service_id in(%s)", TABLEPRE, 2, $ids));
     if ($res) {
         if (is_array($service_ids)) {
             foreach ($service_ids as $key => $val) {
                 $service_info = keke_shop_class::get_service_info($val);
                 $feed_arr = array("feed_username" => array("content" => $service_info['username'], "url" => "index.php?do=seller&id={$service_info['uid']}"), "action" => array("content" => '发布了服务', "url" => ""), "event" => array("content" => "{$service_info['title']}", "url" => "index.php?do=goods&id={$val}", "cash" => "{$service_info['price']}", "model_id" => "{$service_info['model_id']}"));
                 kekezu::save_feed($feed_arr, $service_info['uid'], $service_info['username'], 'pub_service', $service_info['service_id']);
             }
         } else {
             $service_info = db_factory::get_one(sprintf("select * from %switkey_service where service_id=%d", TABLEPRE, $service_ids));
             $feed_arr = array("feed_username" => array("content" => $service_info['username'], "url" => "index.php?do=seller&id={$service_info['uid']}"), "action" => array("content" => '发布服务', "url" => ""), "event" => array("content" => "{$service_info['title']}", "url" => "index.php?do=goods&id={$service_ids}", "cash" => "{$service_info['price']}", "model_id" => "{$service_info['model_id']}"));
             kekezu::save_feed($feed_arr, $service_info['uid'], $service_info['username'], 'pub_service', $service_info['service_id']);
         }
     }
     return $res;
 }
コード例 #3
0
 public function dispose_task()
 {
     global $kekezu, $_lang;
     $prom_obj = $objProm = keke_prom_class::get_instance();
     $model_code = $this->_model_code;
     $agree_info = $this->_agree_info;
     $cash_info = db_factory::get_one(sprintf(" select task_cash,task_union,real_cash from %switkey_task where task_id = '%d'", TABLEPRE, $this->_task_id));
     $this->plus_mark_num();
     keke_user_mark_class::create_mark_log($model_code, '1', $agree_info['seller_uid'], $agree_info['buyer_uid'], $agree_info['work_id'], $cash_info['task_cash'], $this->_task_id, $this->_seller_username, $this->_buyer_username);
     keke_user_mark_class::create_mark_log($model_code, '2', $agree_info['buyer_uid'], $agree_info['seller_uid'], $agree_info['work_id'], $cash_info['real_cash'], $this->_task_id, $this->_buyer_username, $this->_seller_username);
     $site_profit = $cash_info['task_cash'] - $cash_info['real_cash'];
     $task_title = db_factory::get_count(sprintf(" select task_title from %switkey_task where task_id='%d'", TABLEPRE, $this->_task_id));
     $data = array(':task_id' => $this->_task_id, ':task_title' => $task_title);
     keke_finance_class::init_mem('task_bid', $data);
     keke_finance_class::cash_in($agree_info['seller_uid'], $cash_info['real_cash'], 'task_bid', '', 'task', $this->_task_id, $site_profit);
     $feed_arr = array("feed_username" => array("content" => $this->_seller_uid, "url" => "index.php?do=seller&id={$this->_seller_uid}"), "action" => array("content" => $_lang['success_bid_haved'], "url" => ""), "event" => array("content" => $task_title, "url" => "index.php?do=task&id={$this->_task_id}", 'cash' => $cash_info['real_cash']));
     kekezu::save_feed($feed_arr, $this->_seller_uid, $this->_seller_username, 'work_accept', $this->_task_id);
     $prom_obj->dispose_prom_event("bid_task", $agree_info['seller_uid'], $this->_task_id);
     $prom_obj->dispose_prom_event("pub_task", $agree_info['buyer_uid'], $this->_task_id);
 }
コード例 #4
0
 public function auth_confirm($auth_info, $user_get_cash)
 {
     global $user_info, $kekezu, $_lang;
     $uid = $user_info['uid'];
     $username = $user_info['username'];
     $intBankAid = $auth_info[$this->_primary_key];
     $pk[$this->_primary_key] = $intBankAid;
     $data['user_get_cash'] = $user_get_cash;
     $this->_tab_obj->save($data, $pk);
     $ac_url = "index.php?do=user&view=account&op=auth&code=" . $this->_auth_code . "&intBankAid=" . $intBankAid . "#userCenter";
     if ($this->set_auth_status($intBankAid, '1')) {
         $this->set_auth_record_status($uid, '1');
         $objProm = keke_prom_class::get_instance();
         $objProm->dispose_prom_event('reg', $uid, $uid);
         $feed_arr = array("feed_username" => array("content" => $username, "url" => "index.php?do=seller&id={$uid}"), "action" => array("content" => $_lang['have_passed'], "url" => ""), "event" => array("content" => $this->auth_lang(), "url" => ""));
         kekezu::save_feed($feed_arr, $uid, $username, $this->_auth_name);
         $v_arr = array($_lang['auth_code'] => $this->auth_lang(), $_lang['auth_url'] => $ac_url);
         keke_msg_class::notify_user($uid, $username, 'auth_success', $this->auth_lang() . $_lang['success'], $v_arr, 2);
     }
 }
コード例 #5
0
 public function audit_auth($active_code, $email_a_id)
 {
     global $_K, $kekezu, $_lang;
     $user_info = $kekezu->_userinfo;
     if (md5($user_info['uid'] . $user_info['username'] . $user_info['email']) == $active_code) {
         $arrAuthInfo = $this->get_auth_info($email_a_id);
         if (empty($arrAuthInfo[0])) {
             return false;
         }
         $this->set_auth_status($arrAuthInfo[0][$this->_primary_key], '1');
         $this->set_auth_record_status($arrAuthInfo[0]['uid'], '1');
         $objProm = keke_prom_class::get_instance();
         $objProm->dispose_prom_event('reg', $user_info['uid'], $user_info['uid']);
         $feed_arr = array("feed_username" => array("content" => $user_info[username], "url" => "index.php?do=seller&id={$user_info['uid']}"), "action" => array("content" => $_lang['have_passed'], "url" => ""), "event" => array("content" => $this->auth_lang(), "url" => ""));
         kekezu::save_feed($feed_arr, $user_info['uid'], $user_info['username'], 'email_auth');
         $v_arr = array($_lang['auth_code'] => $this->auth_lang(), $_lang['auth_url'] => $_K['siteurl'] . '/index.php?do=user&view=account&op=auth&code=email&ver=1#userCenter');
         keke_msg_class::notify_user($user_info['uid'], $user_info['username'], 'auth_success', $this->auth_lang() . $_lang['success'], $v_arr, 2);
         return true;
     }
     return false;
 }
コード例 #6
0
 public function dispose_order($order_id, $trust_response = false)
 {
     global $kekezu, $uid, $username, $_K;
     global $_lang;
     $response = array();
     $task_config = $this->_task_config;
     $task_info = $this->_task_info;
     $url = $_K['siteurl'] . '/index.php?do=task&id=' . $this->_task_id;
     $task_status = $this->_task_status;
     $order_info = db_factory::get_one("select * from " . TABLEPRE . "witkey_order where order_id=" . intval($order_id));
     $order_amount = $order_info['order_amount'];
     if ($order_info['order_status'] == 'ok') {
         $task_status == 1 && ($notice = $_lang['task_pay_success_and_wait_admin_audit']);
         $task_status == 2 && ($notice = $_lang['task_pay_success_and_task_pub_success']);
         return pay_return_fac_class::struct_response($_lang['operate_notice'], $notice, $url, 'success');
     } else {
         $arrOrderDetail = keke_order_class::get_order_detail($order_id);
         foreach ($arrOrderDetail as $k => $v) {
             if ($v['obj_type'] == 'task' && $v['detail_type'] == null) {
                 $data = array(':model_name' => $this->_model_name, ':task_id' => $this->_task_id, ':task_title' => $this->_task_title);
                 keke_finance_class::init_mem('pub_task', $data);
                 $res = keke_finance_class::cash_out($task_info['uid'], $v['price'], 'pub_task', 0, 'task', $this->_task_id);
             }
             if ($v['obj_type'] == 'task' && $v['detail_type']) {
                 PayitemClass::createPayitemRecord($v['detail_type'], $v['num'], $v['obj_type'], $v['obj_id']);
             }
         }
         switch ($res == true) {
             case "1":
                 $objProm = keke_prom_class::get_instance();
                 if ($objProm->is_meet_requirement("pub_task", $this->_task_id)) {
                     $objProm->create_prom_event("pub_task", $this->_guid, $task_info['task_id'], $task_info['task_cash']);
                 }
                 db_factory::updatetable(TABLEPRE . "witkey_order", array("order_status" => "ok"), array("order_id" => "{$order_id}"));
                 keke_order_class::update_fina_order($res, $order_id);
                 $consume = kekezu::get_cash_consume($task_info['task_cash']);
                 db_factory::execute(sprintf(" update %switkey_task set cash_cost='%s',credit_cost='%s' where task_id='%d'", TABLEPRE, $consume['cash'], $consume['credit'], $this->_task_id));
                 if ($task_info['task_cash'] < $task_config['audit_cash'] && !$this->_trust_mode) {
                     $this->set_task_status(1);
                     return pay_return_fac_class::struct_response($_lang['operate_notice'], $_lang['task_pay_success_and_wait_admin_audit'], $url, 'alert_right');
                 } else {
                     $this->set_task_status(2);
                     $feed_arr = array("feed_username" => array("content" => $task_info['username'], "url" => "index.php?do=seller&id={$task_info['uid']}"), "action" => array("content" => $_lang['pub_task'], "url" => ""), "event" => array("content" => "{$task_info['task_title']}", "url" => "index.php?do=task&id={$task_info['task_id']}", "cash" => $task_info['task_cash_coverage'] ? $task_info['task_cash_coverage'] : $task_info['task_cash'], "model_id" => "{$this->_model_id}"));
                     kekezu::save_feed($feed_arr, $task_info['uid'], $task_info['username'], 'pub_task', $task_info['task_id']);
                     $status_arr = self::get_task_status();
                     $url = '<a href="' . $_K['siteurl'] . '/index.php?do=task&id=' . $task_info['task_id'] . '"  target="_blank">' . $task_info['task_title'] . '</a>';
                     $v = array('model_name' => $this->_model_name, 'task_id' => $task_info['task_id'], $_lang['task_title'] => $task_info['task_title'], $_lang['task_id'] => $task_info['task_id'], $_lang['task_link'] => $url, $_lang['task_status'] => $status_arr[2], '开始时间' => date('Y-m-d H:i:s', $task_info['start_time']), '投稿结束时间' => date('Y-m-d H:i:s', $task_info['sub_time']), '选稿结束时间' => date('Y-m-d H:i:s', $task_info['end_time']));
                     $this->notify_user("task_pub", '任务发布通知', $v, $notify_type = 1, $task_info['uid']);
                     return pay_return_fac_class::struct_response($_lang['operate_notice'], $_lang['task_pay_success_and_task_pub_success'], $url, 'alert_right');
                 }
                 break;
             case "0":
                 $pay_url = $_K['siteurl'] . "/index.php?do=pay&order_id={$order_id}";
                 return pay_return_fac_class::struct_response($_lang['operate_notice'], $_lang['task_pay_error_and_please_repay'], $pay_url, 'alert_error');
                 break;
         }
     }
 }
コード例 #7
0
 public function review_auth($auth_ids, $type = 'pass', $url = null)
 {
     global $_lang;
     global $kekezu;
     if ($url === null) {
         $url = $_SERVER['HTTP_REFERER'];
     }
     $prom_obj = keke_prom_class::get_instance();
     is_array($auth_ids) and $auth_ids = implode(",", $auth_ids);
     $auth_info = $this->get_auth_info($auth_ids);
     $size = sizeof($auth_info);
     $size > 0 && $type == 'pass' and $status = '1' or $status = '2';
     $size == 0 and kekezu::admin_show_msg($this->auth_lang() . $_lang['apply_not_exist_audit_fail'], $_SERVER['HTTP_REFERER']);
     if ($size == 1 && $auth_info[0]['auth_status'] != '1') {
         $this->set_auth_status($auth_info[0][$this->_primary_key], $status);
         $this->set_auth_record_status($auth_info[0]['uid'], $status);
         $this->_auth_code == 'realname' && $status == 1 and $this->extract_birth($auth_info[0]['uid'], $auth_info[0]['id_card']);
     } elseif ($size > 1) {
         foreach ($auth_info as $v) {
             if ($v['auth_status'] != '1') {
                 $this->set_auth_record_status($v['uid'], $status);
                 $this->set_auth_status($v[$this->_primary_key], $status);
                 $this->_auth_code == 'realname' && $status == 1 and $this->extract_birth($v['uid'], $v['id_card']);
             }
         }
     }
     switch ($type) {
         case "pass":
             kekezu::admin_system_log($this->auth_lang() . $_lang['apply_pass'] . "{$auth_ids}");
             foreach ($auth_info as $v) {
                 if ($this->_auth_code == 'enterprise') {
                     $this->set_user_role($auth_info[0][uid], $type);
                 } elseif ($this->_auth_code == 'realname') {
                     $this->set_user_role($auth_info[0][uid], $type);
                 }
                 $feed_arr = array("feed_username" => array("content" => $v[username], "url" => "index.php?do=seller&id={$v['uid']}"), "action" => array("content" => $_lang['has_pass'], "url" => ""), "event" => array("content" => $this->auth_lang(), "url" => ""));
                 kekezu::save_feed($feed_arr, $v['uid'], $v['username'], $this->_auth_name);
                 $prom_obj->dispose_prom_event('reg', $v['uid'], $v['uid']);
                 $auth_arr = keke_glob_class::get_finance_action();
                 $arr[$_lang['auth_code']] = $auth_arr[$this->_auth_name];
                 $arr[$_lang['auth_url']] = "index.php?do=user&view=payitem&op=auth&auth_code={$this->_auth_code}";
                 keke_msg_class::notify_user($v['uid'], $v['username'], 'auth_success', $auth_arr[$this->_auth_name] . $_lang['through'], $arr, 2);
             }
             $url = 'HTTP://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?do=auth&view=list&code={$this->_auth_code}";
             kekezu::admin_show_msg($this->auth_lang() . $_lang['apply_audit_success'], $url, 3, '', 'success');
             break;
         case "not_pass":
             kekezu::admin_system_log($this->auth_lang() . $_lang['apply_not_pass'] . "{$auth_ids}");
             kekezu::admin_show_msg($this->auth_lang() . $_lang['apply_audit_not_pass'], $url, 3, '', 'success');
             break;
     }
 }
コード例 #8
0
ファイル: keke_shop_class.php プロジェクト: pengfeiaaa/web
 public static function create_service_order($service_info, $isApp = false, $serviceOrderInfo = array(), $step = '')
 {
     global $uid, $username, $_K;
     global $_lang;
     if ($uid == $service_info['uid']) {
         if ($isApp) {
             app_class::response(array('ret' => 1003));
         } else {
             return $_lang['seller_can_not_order_self'];
         }
     }
     $oder_obj = new Keke_witkey_order_class();
     $order_detail = new Keke_witkey_order_detail_class();
     switch ($service_info['model_id']) {
         case "6":
             $type = $_lang['work'];
             $service_cash = $service_info['price'];
             break;
         case "7":
             $type = $_lang['service'];
             $service_cash = $serviceOrderInfo['price'];
             break;
     }
     $order_name = $service_info['title'];
     $order_body = $_lang['buy_goods'] . "<a href=\"index.php?do=goods&id={$service_info['service_id']}\">" . $order_name . "</a>";
     if ($service_info['model_id'] == 6) {
         $detail_type = 'goods';
         $order_status = 'wait';
     } else {
         $detail_type = 'service';
         $order_status = 'seller_confirm';
     }
     $order_id = keke_order_class::create_order($service_info['model_id'], $service_info['uid'], $service_info['username'], $order_name, $service_cash, $order_body, $order_status, $service_info['leave_message']);
     if ($order_id) {
         if ($service_info['model_id'] == 7) {
             $serviceOrderInfo['order_id'] = $order_id;
             keke_order_class::createServiceOrder($serviceOrderInfo);
         }
         keke_order_class::create_order_detail($order_id, $order_name, 'service', intval($service_info[service_id]), $service_cash);
         $msg_obj = new keke_msg_class();
         $service_url = "<a href=\"" . $_K[siteurl] . "/index.php?do=goods&id=" . $service_info[service_id] . "\">" . $order_name . "</a>";
         $strLeaveMessage = $service_info['leave_message'];
         $order_url = "<a href=\"" . $_K[siteurl] . "/index.php?do=order&sid=" . $service_info['service_id'] . "&orderId=" . $order_id . "#userCenter\">#" . $order_id . "</a>";
         $s_notice = array($_lang['user_action'] => $username . $_lang['order_buy'], $_lang['service_name'] => $service_url, $_lang['service_type'] => $type, $_lang['buyer_leave_message'] => $strLeaveMessage, $_lang['order_link'] => $order_url);
         if ($service_info['model_id'] == '7') {
             unset($s_notice[$_lang['buyer_leave_message']]);
             $msgAction = 'service_order';
             $shopMx = '服务';
         } else {
             $msgAction = 'goods_order';
             $shopMx = '作品';
         }
         $contact = db_factory::get_one(sprintf(" select mobile,email from %switkey_space where uid='%d'", TABLEPRE, $service_info[uid]));
         if ($service_info['model_id'] != '6' && $step != 'step1') {
             $order_info = keke_order_class::get_order_info($order_id);
             $b_order_link = "<a href=\"" . $_K['siteurl'] . "/index.php?do=user&view=transaction&op=sold&intModelId=" . $order_info['model_id'] . "&order_id=" . $order_id . "\">" . $order_info['order_name'] . "</a>";
             $v_arr = array($_lang['user_msg'] => $order_info['seller_username'], '商品标题' => $order_info['order_name'], $_lang['order_link'] => $b_order_link, '商品模型名称' => $shopMx);
             $msg_obj->send_message($service_info['uid'], $service_info['username'], "order_create", $_lang['you_has_new'] . $type . $_lang['order'], $v_arr, $contact['email'], $contact['mobile']);
             $arrTaskInfo = db_factory::get_one("select * from " . TABLEPRE . "witkey_service where service_id=" . intval($service_info[service_id]));
             $feed_arr = array("feed_username" => array("content" => $arrTaskInfo['username'], "url" => "index.php?do=seller&id=" . $arrTaskInfo['uid']), "action" => array("content" => $_lang['buy'], "url" => ''), "event" => array("content" => $order_name, "url" => "index.php?do=goods&id={$service_info['service_id']}"));
             kekezu::save_feed($feed_arr, $uid, $username, 'buy_' . $detail_type, $service_info['service_id'], $service_url);
             $feed_arr = array("feed_username" => array("content" => $username, "url" => "index.php?do=seller&id=" . $uid), "action" => array("content" => $_lang['buy'], "url" => ''), "event" => array("content" => $order_name, "url" => "index.php?do=goods&id={$service_info['service_id']}"));
             kekezu::save_feed($feed_arr, $arrTaskInfo['uid'], $arrTaskInfo['username'], 'buy_' . $detail_type . '_bei', $service_info['service_id'], $service_url);
         }
         if ($isApp) {
             app_class::response(array('ret' => 0, 'orderid' => $order_id));
         } else {
             return $order_id;
         }
     } else {
         if ($isApp) {
             app_class::response(array('ret' => 1004));
         } else {
             return $_lang['order_produce_fail'];
         }
     }
 }
コード例 #9
0
 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);
     }
 }
コード例 #10
0
ファイル: keke_task_config.php プロジェクト: pengfeiaaa/web
 public static function task_audit_pass($task_ids)
 {
     global $_lang, $kekezu;
     if ($task_ids && is_array($task_ids)) {
         $ids = implode(',', $task_ids);
         $task_arr = db_factory::query(sprintf("select task_id,model_id,task_title,task_cash,task_status,uid,username,start_time,sub_time,end_time,payitem_time,task_cash_coverage from %switkey_task where task_id in(%s) and task_status in (0,1)", TABLEPRE, $ids));
         foreach ($task_arr as $v) {
             kekezu::admin_system_log($_lang['audit_task'] . ":{$v['task_title']}" . $_lang['pass']);
             $payitem_add_time = time() - $v['start_time'];
             $payitem_arr = unserialize($v['payitem_time']);
             intval($payitem_arr['top']) > 0 or $top_add_time = false;
             intval($payitem_arr['urgent']) > 0 or $urgent_add_time = false;
             $payitem_time = keke_task_class::get_payitem($v['payitem_time'], $top_add_time, $urgent_add_time);
             $sub_time = time() + ($v['sub_time'] - $v['start_time']);
             $end_time = time() + ($v['end_time'] - $v['start_time']);
             $res = db_factory::execute(sprintf("update %switkey_task set task_status=2 ,start_time='%d',sub_time='%d',end_time='%d',payitem_time='%s'  where task_id in(%s)", TABLEPRE, time(), $sub_time, $end_time, $payitem_time, $v['task_id']));
             $_model_info = $kekezu->_model_list[$v['model_id']];
             if (in_array($_model_info['model_code'], array('sreward', 'mreward', 'preward'))) {
                 $task_cash = $v['task_cash'];
             } else {
                 $task_cash = $v['task_cash_coverage'];
             }
             $info = db_factory::get_one('select union_user,union_assoc from ' . TABLEPRE . 'witkey_space where uid=' . $v['uid']);
             $feed_arr = array("feed_username" => array("content" => $v['username'], "url" => "index.php?do=seller&id={$v['uid']}"), "action" => array("content" => $_lang['pub_task'], "url" => ""), "event" => array("content" => "{$v['task_title']}", "url" => "index.php?do=task&id={$v['task_id']}", "cash" => $v['task_cash_coverage'] ? $v['task_cash_coverage'] : $v['task_cash'], "model_id" => "{$v['model_id']}"));
             kekezu::save_feed($feed_arr, $v['uid'], $v['username'], 'pub_task', $v['task_id']);
             PayitemClass::updateTopitem($v['task_id'], 'task');
         }
     } elseif ($task_ids) {
         $ids = $task_ids;
         $task_info = db_factory::get_one(sprintf("select task_id,model_id,task_title,task_cash_coverage,task_cash,task_status,uid,username,start_time,sub_time,end_time,payitem_time from %switkey_task where task_id = '%d' and task_status in (0,1)", TABLEPRE, $ids));
         $_model_info = $kekezu->_model_list[$task_info['model_id']];
         if ($task_info) {
             $payitem_add_time = time() - $task_info['start_time'];
             $payitem_arr = unserialize($task_info['payitem_time']);
             $payitem_arr['top'] > 1000000000 and $top_add_time = $payitem_add_time or $top_add_time = false;
             $payitem_arr['urgent'] > 1000000000 and $urgent_add_time = $payitem_add_time or $urgent_add_time = false;
             $payitem_time = keke_task_class::get_payitem($task_info['payitem_time'], $top_add_time, $urgent_add_time);
             $sub_time = time() + (intval($task_info['sub_time']) - intval($task_info['start_time']));
             $end_time = time() + ($task_info['end_time'] - $task_info['start_time']);
             $sql = sprintf("update %switkey_task set task_status=2 ,start_time='%d',sub_time='%d',end_time='%d',payitem_time='%s'  where task_id  ='%d' ", TABLEPRE, time(), $sub_time, $end_time, $payitem_time, $task_info['task_id']);
             $res = db_factory::execute($sql);
             if (in_array($_model_info['model_code'], array('sreward', 'mreward', 'preward'))) {
                 $task_cash = $task_info['task_cash'];
             } else {
                 $task_cash = $task_info['task_cash_coverage'];
             }
             $info = db_factory::get_one('select union_user,union_assoc from ' . TABLEPRE . 'witkey_space where uid=' . $task_info['uid']);
             kekezu::admin_system_log($_lang['audit_task'] . ":{$task_info['task_title']}" . $_lang['pass']);
             $feed_arr = array("feed_username" => array("content" => $task_info['username'], "url" => "index.php?do=seller&id={$task_info['uid']}"), "action" => array("content" => $_lang['pub_task'], "url" => ""), "event" => array("content" => "{$task_info['task_title']}", "url" => "index.php?do=task&id={$task_info['task_id']}", "cash" => $task_info['task_cash_coverage'] ? $task_info['task_cash_coverage'] : $task_info['task_cash'], "model_id" => "{$task_info['model_id']}"));
             kekezu::save_feed($feed_arr, $task_info['uid'], $task_info['username'], 'pub_task', $task_info['task_id']);
             PayitemClass::updateTopitem($task_info['task_id'], 'task');
         }
     }
     return $res;
 }
コード例 #11
0
ファイル: buyer_order.php プロジェクト: xupnge1314/project
         $serviceOrderInfo['content'] = kekezu::escape($content);
         $serviceOrderInfo['file_ids'] = $file_ids;
         $serviceOrderInfo['price'] = floatval($price);
         $orderId = keke_order_class::create_order(7, $arrSellerInfo['uid'], $arrSellerInfo['username'], $serviceOrderInfo['title'], $serviceOrderInfo['price'], '雇佣服务:' . $serviceOrderInfo['title'], 'seller_confirm');
         if ($orderId) {
             $serviceOrderInfo['order_id'] = $orderId;
             keke_order_class::create_order_detail($orderId, $serviceOrderInfo['title'], 'gy', $serviceOrderInfo['service_id'], $serviceOrderInfo['price']);
             keke_order_class::createServiceOrder($serviceOrderInfo);
             $order_url = "<a href=\"" . $_K['siteurl'] . "/index.php?do=gy&id=" . $arrSellerInfo['uid'] . "&orderId=" . $orderId . "\">" . $title . "</a>";
             $v_arr = array('用户名' => $arrSellerInfo['username'], '用户' => $username, '雇佣订单链接' => $order_url, '网站名称' => $kekezu->_sys_config['website_name']);
             $msg_obj = new keke_msg_class();
             $msg_obj->send_message($arrSellerInfo['uid'], $arrSellerInfo['username'], 'gy_order_notice', '雇佣订单消息', $v_arr);
             $feed_arr = array("feed_username" => array("content" => $arrSellerInfo['username'], "url" => "index.php?do=seller&id=" . $arrSellerInfo['uid']), "action" => array("content" => '雇佣', "url" => ''), "event" => array("content" => $serviceOrderInfo['title'], "url" => ""));
             kekezu::save_feed($feed_arr, $gUid, $gUsername, 'gy', $id, '');
             $feed_arr = array("feed_username" => array("content" => $gUsername, "url" => "index.php?do=seller&id=" . $gUid), "action" => array("content" => '雇佣', "url" => ''), "event" => array("content" => $serviceOrderInfo['title'], "url" => ""));
             kekezu::save_feed($feed_arr, $arrSellerInfo['uid'], $arrSellerInfo['username'], 'gy_bei', $id, '');
             kekezu::show_msg('订单创建成功', $strUrl . "&step=step2&orderId=" . $orderId, 3, null, 'ok');
         } else {
             kekezu::show_msg('创建订单失败', $strUrl, 3, null, 'fail');
         }
     }
     break;
 case 'step2':
     break;
 case 'step3':
     if (isset($action)) {
         switch ($action) {
             case 'pay':
                 $objShop = new service_shop_class();
                 $resText = $objShop->dispose_order($orderId, 'ok');
                 unset($objShop);
コード例 #12
0
ファイル: pub.php プロジェクト: pengfeiaaa/web
        $taskId = intval($taskId);
        if (0 === $taskId) {
            kekezu::show_msg('无权访问', $strUrl, 3, NULL, 'warning');
        }
        $arrTaskInfo = $objRelease->check_access($step, $id, $arrPubInfo, $taskId);
        $arrPayInfo = $objRelease->checkWhetherToPay($taskId);
        $boolValue = $arrPayInfo['balance_pay'];
        $floatPayCash = $arrPayInfo['total_cash'];
        $iStatus = intval($arrTaskInfo['task_status']);
        if (!$floatPayCash && 0 === $iStatus) {
            $objProm = keke_prom_class::get_instance();
            if ($objProm->is_meet_requirement("pub_task", $arrTaskInfo['task_id'])) {
                $objProm->create_prom_event("pub_task", $arrTaskInfo['uid'], $arrTaskInfo['task_id'], $arrTaskInfo['task_cash']);
            }
            $tenderObj = new tender_task_class($arrTaskInfo);
            if ($arrConfig['zb_audit'] == 1) {
                $tenderObj->set_task_status(1);
            } else {
                $tenderObj->set_task_status(2);
                $feed_arr = array("feed_username" => array("content" => $arrTaskInfo['username'], "url" => "index.php?do=seller&id={$arrTaskInfo['uid']}"), "action" => array("content" => $_lang['pub_task'], "url" => ""), "event" => array("content" => "{$arrTaskInfo['task_title']}", "url" => "index.php?do=task&id={$arrTaskInfo['task_id']}", "cash" => $arrTaskInfo['task_cash_coverage'] ? $arrTaskInfo['task_cash_coverage'] : $arrTaskInfo['task_cash'], "model_id" => $arrTaskInfo['model_id']));
                kekezu::save_feed($feed_arr, $arrTaskInfo['uid'], $arrTaskInfo['username'], 'pub_task', $arrTaskInfo['task_id']);
                $status_arr = self::get_task_status();
                $url = '<a href="' . $_K['siteurl'] . '/index.php?do=task&id=' . $arrTaskInfo['task_id'] . '"  target="_blank">' . $arrTaskInfo['task_title'] . '</a>';
                $v = array('model_name' => $tenderObj->_model_name, 'task_id' => $arrTaskInfo['task_id'], $_lang['task_title'] => $arrTaskInfo['task_title'], $_lang['task_id'] => $arrTaskInfo['task_id'], $_lang['task_link'] => $url, $_lang['task_status'] => $status_arr[2], '开始时间' => date('Y-m-d H:i:s', $arrTaskInfo['start_time']), '投稿结束时间' => date('Y-m-d H:i:s', $arrTaskInfo['sub_time']), '选稿结束时间' => date('Y-m-d H:i:s', $arrTaskInfo['end_time']));
                $tenderObj->notify_user("task_pub", '任务发布通知', $v, $notify_type = 1, $arrTaskInfo['uid']);
            }
        }
        break;
}
require keke_tpl_class::template('pubtask');
die;
コード例 #13
0
 public function dispose_order($order_id)
 {
     global $kekezu, $_K;
     global $_lang;
     $task_info = $this->_task_info;
     $task_status = $this->_task_status;
     $url = $_K['siteurl'] . '/index.php?do=task&id=' . $this->_task_id;
     $order_info = db_factory::get_one(sprintf("select * from %switkey_order where order_id='%d'", TABLEPRE, $order_id));
     $order_amount = $order_info['order_amount'];
     if ($order_info['order_status'] == 'ok') {
         $task_status == 1 && ($notice = $_lang['task_pay_success_and_wait_admin_audit']);
         $task_status == 2 && ($notice = $_lang['task_pay_success_and_task_pub_success']);
         return pay_return_fac_class::struct_response($_lang['operate_notice'], $notice, $url, 'success');
     } else {
         $balance = floatval($this->_g_userinfo['balance']);
         $order_amount = floatval($order_info['order_amount']);
         $leave_cash = $balance - $order_amount;
         if ($leave_cash >= 0) {
             $order_type = db_factory::get_count(sprintf("select obj_type from %switkey_order_detail where order_id='%d' and obj_type in('hosted','task') ", TABLEPRE, $order_id));
             if ($order_type == 'hosted') {
                 $action = 'hosted_margin';
                 $to_status = 6;
                 $msg = $_lang['order_pay_success_and_task_cash_trust_succss'];
             } else {
                 $action = 'pub_task';
                 if ($this->_task_config['open_audit'] == 'close') {
                     $to_status = 2;
                     $msg = $_lang['order_pay_success_and_your_task_success'];
                 } else {
                     $to_status = 1;
                     $msg = $_lang['order_pay_success_and_wait_amin_audit'];
                 }
             }
             $arrOrderDetail = keke_order_class::get_order_detail($order_id);
             foreach ($arrOrderDetail as $k => $v) {
                 if (($v['obj_type'] == 'task' || $v['obj_type'] == 'hosted') && $v['detail_type'] == null) {
                     $data = array($kekezu->_model_list[$task_info['model_id']]['model_name'], $task_info['task_id'], $task_info['task_title']);
                     keke_finance_class::init_mem($action, $data);
                     $res = keke_finance_class::cash_out($this->_guid, $v['price'], $action, 0, 'task', $this->_task_id);
                 } else {
                     PayitemClass::createPayitemRecord($v['detail_type'], $v['num'], $v['obj_type'], $v['obj_id']);
                 }
             }
             if ($res) {
                 $objProm = keke_prom_class::get_instance();
                 if ($objProm->is_meet_requirement("pub_task", $this->_task_id)) {
                     $objProm->create_prom_event("pub_task", $this->_guid, $this->_task_id, $this->_task_info['real_cash']);
                 }
                 keke_order_class::update_fina_order($res, $order_id);
                 if ($action == 'pub_task') {
                     if ($to_status == '2') {
                         $feed_arr = array("feed_username" => array("content" => $task_info['username'], "url" => "index.php?do=seller&id={$task_info['uid']}"), "action" => array("content" => $_lang['pub_task'], "url" => ""), "event" => array("content" => "{$task_info['task_title']}", "url" => "index.php?do=task&id={$task_info['task_id']}", "cash" => $task_info['task_cash_coverage'] ? $task_info['task_cash_coverage'] : $task_info['task_cash'], "model_id" => "{$this->_model_id}"));
                         kekezu::save_feed($feed_arr, $task_info['uid'], $task_info['username'], 'pub_task', $task_info['task_id']);
                         $status_arr = self::get_task_status();
                         $url = '<a href="' . $_K['siteurl'] . '/index.php?do=task&id=' . $task_info['task_id'] . '"  target="_blank">' . $task_info['task_title'] . '</a>';
                         $v = array('model_name' => $this->_model_name, 'task_id' => $task_info['task_id'], $_lang['task_title'] => $task_info['task_title'], $_lang['task_id'] => $task_info['task_id'], $_lang['task_link'] => $url, $_lang['task_status'] => $status_arr[2], '开始时间' => date('Y-m-d H:i:s', $task_info['start_time']), '投稿结束时间' => date('Y-m-d H:i:s', $task_info['sub_time']), '选稿结束时间' => date('Y-m-d H:i:s', $task_info['end_time']));
                         $this->notify_user("task_pub", '任务发布通知', $v, $notify_type = 1, $task_info['uid']);
                     }
                     db_factory::execute(sprintf(" update %switkey_task set cash_cost='%s' where task_id='%d'", TABLEPRE, $task_info['task_cash'], $this->_task_id));
                 }
                 $this->set_task_status($to_status);
                 keke_order_class::set_order_status($order_id, 'ok');
                 return pay_return_fac_class::struct_response($_lang['operate_notice'], $_lang['order_pay_success'], $url, 'success');
             } else {
                 $pay_url = $_K['siteurl'] . "/index.php?do=pay&order_id={$order_id}";
                 return pay_return_fac_class::struct_response($_lang['operate_notice'], $_lang['task_pay_error_and_please_repay'], $url, 'warning');
             }
         } else {
             $pay_url = $_K['siteurl'] . "/index.php?do=pay&order_id={$order_id}";
             return pay_return_fac_class::struct_response($_lang['operate_notice'], $_lang['task_pay_error_and_please_repay'], $pay_url, 'warning');
         }
     }
 }
コード例 #14
0
             }
             $withdraw_obj->setWithdraw_status(3);
             $res = $withdraw_obj->edit_keke_witkey_withdraw();
             kekezu::admin_system_log($_lang['delete_audit_withdraw'] . $ids);
             break;
         case $_lang['mulit_review']:
             $withdraw_obj->setWhere(' withdraw_id in (' . $ids . ') ');
             $withdraw_arr = $withdraw_obj->query_keke_witkey_withdraw();
             foreach ($withdraw_arr as $k => $v) {
                 if ($v[withdraw_status] == 1) {
                     $fee = $v['withdraw_cash'] - keke_finance_class::get_to_cash($v['withdraw_cash']);
                     db_factory::execute(sprintf(' update %switkey_withdraw set fee=%.2f where withdraw_id=%d', TABLEPRE, $fee, $v['withdraw_id']));
                     $v_arr = array('网站名称' => $_K['sitename'], '提现方式' => $pay_way[$v['pay_type']], '帐户' => $v['pay_account'], '提现金额' => $v['withdraw_cash']);
                     keke_msg_class::notify_user($v['uid'], $v['username'], 'draw_success', $_lang['withdraw_success'], $v_arr);
                     $feed_arr = array("feed_username" => array("content" => $v['username'], "url" => "index.php?do=seller&id=" . $space_info['uid']), "action" => array("content" => $_lang['withdraw'], "url" => ""), "event" => array("content" => $_lang['withdraw_le'] . $v['withdraw_cash'] . $_lang['yuan'], "url" => ""));
                     kekezu::save_feed($feed_arr, $user_space_info['uid'], $user_space_info['username'], 'withdraw');
                     $withdraw_obj = new Keke_witkey_withdraw_class();
                     $withdraw_obj->setWhere(' withdraw_id in (' . $ids . ') ');
                     $withdraw_obj->setWithdraw_status(2);
                     $withdraw_obj->setProcess_uid($admin_info['uid']);
                     $withdraw_obj->setProcess_username($admin_info['username']);
                     $withdraw_obj->setProcess_time(time());
                     $withdraw_obj->edit_keke_witkey_withdraw();
                 }
             }
             kekezu::admin_system_log($_lang['audit_withdraw_apply'] . $ids);
             break;
     }
     kekezu::admin_show_msg($_lang['mulit_operate_success'], 'index.php?do=' . $do . '&view=' . $view, 3, '', 'success');
 } else {
     kekezu::admin_show_msg($_lang['choose_operate_item'], 'index.php?do=' . $do . '&view=' . $view, 3, '', 'warning');