Strict Standards: Declaration of action_plugin_blog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/blog/action.php on line 13

Strict Standards: Declaration of action_plugin_indexmenu::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/indexmenu/action.php on line 13

Strict Standards: Declaration of action_plugin_importoldchangelog::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/importoldchangelog/action.php on line 8

Strict Standards: Declaration of action_plugin_importoldindex::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/importoldindex/action.php on line 8

Strict Standards: Declaration of action_plugin_include::register() should be compatible with DokuWiki_Action_Plugin::register($controller) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/lib/plugins/include/action.php on line 19

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 208

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 211

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 421

Deprecated: Assigning the return value of new by reference is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/parserutils.php on line 594

Strict Standards: Declaration of cache_instructions::retrieveCache() should be compatible with cache::retrieveCache($clean = true) in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/cache.php on line 291

Deprecated: Function split() is deprecated in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/inc/auth.php on line 154

Strict Standards: Only variables should be passed by reference in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/doku.php on line 73
リード配信比率設定 [開発チーム]
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/data/cache/9/9bc158fcf81199b2a806393a8c5bda2b.i failed
Unable to save cache file. Hint: disk full; file permissions; safe_mode setting.
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/data/cache/9/9bc158fcf81199b2a806393a8c5bda2b.i failed
Unable to save cache file. Hint: disk full; file permissions; safe_mode setting.
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/data/cache/f/f305d54b5a90d4c98baabe5ad939dda4.code failed
Writing /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/data/cache/9/9bc158fcf81199b2a806393a8c5bda2b.xhtml failed

リード配信比率設定

  • 単価×CVR
  • 直近2週間
  • 配信開始3日以内はデフォルトチェック案件は CVR:50% デフォルトチェック無し案件は CVR:5% で仮指定
  1. lc_start_time
  2. lc_check_status
-- 順位付け用カラムの追加
ALTER TABLE lead_clients ADD lc_point int;
ALTER TABLE lead_clients ALTER lc_point SET DEFAULT 0;
UPDATE lead_clients  SET lc_point  = 0;
SELECT
	*
FROM
	lead_clients
ORDER BY
	lc_point DESC
  • chmod 755 /home/fideli/crons/makeLeadRate.php
[fideli@fideli1 crons]$ crontab -e
#リード広告配信順序設定
0 8 * * * php  /home/fideli/crons/makeLeadRate.php
<?php
//  リード広告配信順序作成
 
require_once ("/home/fideli/etc/configure.inc");
require_once (COMMON_CLASS_DIR."PearDB.php");
 
 
//  現在の時間
define("DF_TIME",time());
 
//  CVR計測判定期間
define("DF_TIME_LOG",strtotime("-14 day",DF_TIME));
 
//  新参優先ロジック期間
define("DF_TIME_START",strtotime("-3 day",DF_TIME));
 
$db = new PearDB();  # PearDB
$clients = array();
if($res = $db->DBSelect(getClients())){
  foreach($res as $key => $val){
  //  配信数、成果が取得できない場合があるので初期値を指定
    $val["point"] = 0;
    $val["rate"] = 0;
    $val["view"] = 0;
    $val["action"] = 0;
  //  timestampの方が扱いやすいので変換
    $val["time"] = strtotime($val["lc_start_time"]);
    $clients[$val["lc_uniqnum"]] = $val;
  }
}else{
  die("target non");
}
 
//  ログ数取得
if($res = $db->DBSelect(getViewSql())){
  foreach($res as $key => $val){
    $clients[$val["lcil_lc_uniqnum"]]["view"] = $val["count"];
  }
}
 
//  成果数取得
if($res = $db->DBSelect(getActionSql())){
  foreach($res as $key => $val){
    $clients[$val["lcm_lc_uniqnum"]]["action"] = $val["count"];
  }
}
 
foreach($clients as $key => $val){
  if($val["time"] >= DF_TIME_START){
  //  3日前より近いのはレート 0.5
    $val["rate"] = 0.5;
  }elseif($val["view"] && $val["action"]){
  //  どちらかが0の場合は結局0になるので
    $val["rate"] = $val["action"]/$val["view"];
  }
  //  0.001まで判定(カラムの都合上整数に変換)
  $val["rate_new"] = ceil($val["rate"]*1000);
  if($val["rate_new"] && $val["lc_cpc"]){
  //  単価が入っている想定、成果が無ければpointは付かない
    $val["point"] = $val["rate_new"] * $val["lc_cpc"];
  }
  $clients[$key] = $val;
}
 
foreach($clients as $key => $val){
  $hash = array();
  $hash["lc_point"] = $val["point"];
  $WhereHash = array($val["lc_uniqnum"]);
  $WhereSql = " lc_uniqnum = ?";
  if($db->DBUpdate("lead_clients",$hash,$WhereSql,$WhereHash)){
  }
}
die("Fin");
 
 
//  表示回数Sql
function getViewSql(){
  return "SELECT
        lcil_lc_uniqnum,
        count(*)
      FROM
        lead_client_indication_log
      WHERE
        lcil_reg_time >= '".date("Y-m-d",DF_TIME_LOG)."'
      GROUP BY
        lcil_lc_uniqnum";
}
function getActionSql(){
  return "SELECT
        lcm_lc_uniqnum,
        count(*)
      FROM
        lead_client_management
      WHERE
        lcm_reg_time >= '".date("Y-m-d",DF_TIME_LOG)."'
      GROUP BY
        lcm_lc_uniqnum";
}
function getClients(){
  return "SELECT
        lc_uniqnum,
        lc_start_time,
        lc_cpc
      FROM
        lead_clients";
}

システム仕込み部

  $fruit = array( "p" => array("ap"), "b" => array("ba"), "o" => array("or") );
   $res[] = array_shift($fruit);
   shuffle ( $fruit );
リード配信比率設定.txt · 最終更新: 2010/07/27 15:46 (外部編集)
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0

Strict Standards: Only variables should be passed by reference in /var/www/vhosts/w629.ws.domainking.cloud/enjoy-lei.com/dokuwiki/doku.php on line 81