This commit is contained in:
Jaybe
2025-03-05 14:02:29 +09:00
commit 247a7808d3
357 changed files with 161196 additions and 0 deletions
@@ -0,0 +1,215 @@
<?php
namespace App\Controllers\Advertisement;
use App\Controllers\BaseController;
use App\Models\Api\AdLeadModel;
use App\ThirdParty\facebook_api\ZenithFB;
use App\ThirdParty\googleads_api\ZenithGG;
use App\ThirdParty\moment_api\ZenithKM;
use CodeIgniter\CLI\CLI;
class AdLeadController extends BaseController
{
protected $adlead, $facebook, $google, $kakao;
public function __construct()
{
$this->adlead = model(AdLeadModel::class);
$this->facebook = new ZenithFB();
$this->google = new ZenithGG();
$this->kakao = new ZenithKM();
}
public function sendToEventLead()
{
CLI::clearScreen();
CLI::write("잠재고객 업데이트를 시작합니다.", "yellow");
$this->sendToEventLeadFromKakao();
$this->sendToEventLeadFromFacebook();
//$this->sendToEventLeadFromGoogle();
CLI::write("잠재고객 업데이트가 완료되었습니다.", "yellow");
}
private function sendToEventLeadFromKakao()
{
$moment_ads = $this->adlead->getBizFormUserResponse();
$step = 1;
$total = $moment_ads->getNumRows();
if(!$total){
return null;
}
CLI::write("카카오 모먼트 잠재고객 업데이트를 시작합니다.", "yellow");
foreach($moment_ads->getResultArray() as $row){
CLI::showProgress($step++, $total);
if (!empty($row['code'])) {
$title = trim($row['code']);
}else{
$title = $row['name'];
}
$landing = $this->kakao->landingGroup($title, $row['landingUrl'] ?? '');
if(is_null($landing)) {
CLI::print('비즈폼 매칭 오류 발생 : ' . $row . '');
continue;
}
//전화번호
$phone = str_replace("+82010", "010", $row['phoneNumber']);
$phone = str_replace("+8210", "010", $phone);
$phone = preg_replace("/^8210(.+)$/", "010$1", $phone);
$phone = str_replace("+82 10", "010", $phone);
$phone = str_replace("-", "", $phone);
if ($row['email'] == '없음') $row['email'] = '';
//추가질문
$questions = [];
$add = [];
$responses = json_decode($row['responses'], 1);
$acnt = 1;
$addr = $add1 = $add2 = $add3 = $add4 = $add5 = null;
foreach ($responses as $response) {
$qs = $this->adlead->getBizformQuestion($row['bizFormId'], $response['bizformItemId']);
if(is_null($qs)) continue;
if (!key_exists($qs['id'], $questions))
$questions[$qs['id']] = $qs['title'];
$add[] = ${'add' . $acnt} = $questions[$response['bizformItemId']] . '::' . $response['response'];
$acnt++;
}
$result = [];
if ($landing['event_seq']) {
$result['event_seq'] = $landing['event_seq'];
$result['site'] = $landing['site']??null;
$result['name'] = $row['nickname'];
$result['email'] = $row['email']??'';
$result['gender'] = $row['gender']??null;
$result['age'] = $row['age'] ?? 0;
$result['phone'] = $phone;
$result['add1'] = $add1;
$result['add2'] = $add2;
$result['add3'] = $add3;
$result['add4'] = $add4;
$result['add5'] = $add5;
$result['addr'] = $addr;
$result['reg_timestamp'] = strtotime($row['submitAt']);
$result['lead_id'] = $row['id']??null;
$result['encUserId'] = $row['encUserId'];
$result['bizFormId'] = $row['bizFormId'];
}
if (is_array($result) && count($result)) {
$this->adlead->insertEventLeadKakao($result);
}
}
}
private function sendToEventLeadFromFacebook()
{
$facebook_ads = $this->adlead->getFBAdLead();
$step = 1;
$total = count($facebook_ads);
if(!$total){
return null;
}
CLI::write("페이스북 잠재고객 업데이트를 시작합니다.", "yellow");
foreach($facebook_ads as $row){
CLI::showProgress($step++, $total);
if (!empty($row['code'])) {
$title = trim($row['code']);
}else{
$title = $row['ad_name'];
}
$landing = $this->facebook->landingGroup($title);
//이름
$full_name = $row['full_name'];
if (!$full_name || $full_name == null) {
$full_name = trim($row['first_name'] . ' ' . $row['last_name']);
}
//성별
if ($row['gender'] == "female") {
$gender = "여자";
} elseif ($row['gender'] == "male") {
$gender = "남자";
} else {
$gender = $row['gender'];
}
//나이
if ($row['date_of_birth']) {
$birthyear = date("Y", strtotime($row['date_of_birth']));
$nowyear = date("Y");
$age = $nowyear - $birthyear + 1;
} else {
$age = "";
}
//전화번호
$phone = str_replace("+82010", "010", $row['phone_number']);
$phone = str_replace("+8210", "010", $phone);
$phone = str_replace("-", "", $phone);
//주소
if ($row['street_address']) {
$addr = $row['street_address'];
} else {
$addr = "";
}
//추가질문
preg_match_all("/0 => \'(.*)\',/iU", $row['field_data'], $match);
if (isset($match[1][0])) {
$add1 = $match[1][0];
} else {
$add1 = "";
}
if (isset($match[1][1])) {
$add2 = $match[1][1];
} else {
$add2 = "";
}
if (isset($match[1][2])) {
$add3 = $match[1][2];
} else {
$add3 = "";
}
if (isset($match[1][3])) {
$add4 = $match[1][3];
} else {
$add4 = "";
}
if (isset($match[1][4])) {
$add5 = $match[1][4];
} else {
$add5 = "";
}
if ($landing['event_seq']) {
$result['event_seq'] = $landing['event_seq'];
$result['site'] = $landing['site'];
$result['name'] = addslashes($full_name);
$result['gender'] = $gender;
$result['age'] = $age ?? 0;
$result['phone'] = $phone;
$result['add1'] = addslashes($add1);
$result['add2'] = addslashes($add2);
$result['add3'] = addslashes($add3);
$result['add4'] = addslashes($add4);
$result['add5'] = addslashes($add5);
$result['addr'] = $addr;
$result['reg_date'] = $row['created_time'];
$result['id'] = $row['id'];
if (is_array($result)) {
$this->adlead->insertEventLeadFacebook($result);
}
}
}
}
private function sendToEventLeadFromGoogle()
{
}
}
@@ -0,0 +1,64 @@
<?php
namespace App\Controllers\Advertisement;
use App\Controllers\BaseController;
use App\ThirdParty\facebook_api\ZenithFB;
use App\ThirdParty\moment_api\ZenithKM;
use App\ThirdParty\googleads_api\ZenithGG;
class ApiController extends BaseController
{
protected $chainsaw;
/*
public function __construct(...$params) {
print_r($params); exit;
include APPPATH."/ThirdParty/facebook_api/facebook-api.php";
$this->chainsaw = new \ChainsawFB();
}
*/
public function _remap($method, ...$params) {
if (method_exists($this, $method)) {
return $this->{$method}(...$params);
}
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
}
protected function facebook(...$params) {
$this->chainsaw = new ZenithFB();
$this->fb_func(...$params);
}
protected function moment(...$params) {
$this->chainsaw = new ZenithKM();
$this->fb_func(...$params);
}
protected function google(...$params) {
$this->chainsaw = new ZenithGG();
$this->fb_func(...$params);
}
protected function fb_func(...$params) {
if (method_exists($this->chainsaw, $params[0])) {
$result = $this->chainsaw->{$params[0]}();
if(in_array('grid', $params)) $this->chainsaw->grid($result);
return $result;
}
}
//안쓰는거
/*
protected function kakaoMoment(...$params) {
include APPPATH."/ThirdParty/moment_api/kmapi.php";
$this->chainsaw = new \ChainsawKM();
$this->km_func(...$params);
}
protected function km_func(...$params) {
if (method_exists($this->chainsaw, $params[0])) {
$result = $this->chainsaw->{$params[0]}();
if(in_array('grid', $params)) $this->chainsaw->grid($result);
return $result;
}
}
*/
}
+162
View File
@@ -0,0 +1,162 @@
<?php
namespace App\Controllers\Advertisement;
use App\ThirdParty\facebook_api\ZenithFB;
use App\Libraries\slack_api\SlackChat;
use CodeIgniter\CLI\CLI;
use CodeIgniter\Controller;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use DateInterval;
use DatePeriod;
class Facebook extends Controller
{
private $zenith;
private $slack;
public function __construct()
{
$this->zenith = new ZenithFB();
$this->slack = new SlackChat();
}
public function initController(
RequestInterface $request,
ResponseInterface $response,
LoggerInterface $logger
) {
$date = "";
$today = date('Y-m-d');
$argv = @$request->getServer()['argv'];
if(!is_null($argv)) {
$method = $argv[2];
$params = @array_slice($argv, 3);
if(!@count($params)) return;
foreach($params as $v) {
$value = preg_replace('/[^0-9\-]+/', '', $v);
if(preg_match('/^[0-9]{4}-[0-9]{1,2}-[0-9]{1,2}$/', $value)) { //request argument에 날짜형식이 있는지 체크
$date = $v;
break;
}
}
/*
$hour = date("G"); //24-hour format of an hour without leading zeros
if($date == $today && ($hour >= 0 && $hour <= 7)) {
CLI::write("당일 0시~8시는 자동업데이트를 사용할 수 없습니다.", "light_purple");
exit;
}
*/
}
}
public function getAccounts() {
$this->zenith->updateAdAccounts();
}
public function getLongLivedAccessToken() {
$this->zenith->getLongLivedAccessToken();
}
public function getInsight($all=null, $date=null, $edate=null) {
CLI::clearScreen();
if($all == null)
$all = CLI::prompt("인사이트가 수신된 캠페인,광고그룹,광고 데이터를 함께 수신하시겠습니까?\n(시간이 오래 걸릴 수 있습니다.)", ["true","false"]);
if($date == null)
$date = CLI::prompt("인사이트를 수신할 기간 중 시작날짜를 입력해주세요.", date('Y-m-d'));
if($edate == null)
$edate = CLI::prompt("인사이트를 수신할 기간 중 종료날짜를 입력해주세요.", $date);
// $run = CLI::prompt("광고데이터를 ".($all=="true"?"포함":"미포함")."하여 {$date} ~ {$edate} 기간의 인사이트를 수신합니다.",["y","n"]);
// if($run != 'y') return false;
$this->zenith->getAsyncInsights($all, $date, $edate);
CLI::write("데이터 수신이 완료되었습니다.", "yellow");
}
public function adLeadByAd($ad_id = null, $from = null, $to = null) {
CLI::clearScreen();
if($ad_id == null)
$ad_id = CLI::prompt("잠재고객 업데이트 할 광고ID를 입력해주세요.");
if($from == null)
$from = CLI::prompt("잠재고객 업데이트 할 시작날짜를 입력해주세요.", date('Y-m-d'));
if($to == null)
$to = CLI::prompt("잠재고객 업데이트 할 종료날짜를 입력해주세요.", $from);
$result = $this->zenith->adLeadByAd($ad_id, $from, $to);
CLI::write("잠재고객 업데이트 완료되었습니다.", "yellow");
}
public function getAdLead($from = null, $to = null) {
CLI::clearScreen();
if($from == null)
$from = CLI::prompt("잠재고객 업데이트 할 시작날짜를 입력해주세요.", date('Y-m-d'));
if($to == null)
$to = CLI::prompt("잠재고객 업데이트 할 종료날짜를 입력해주세요.", date('Y-m-d'));
// $run = CLI::prompt("{$from}~{$to}일자의 잠재고객을 업데이트 합니다.",["y","n"]);
// if($run != 'y') return false;
$this->zenith->getAdLead($from, $to);
}
public function updateAll() {
CLI::clearScreen();
// $run = CLI::prompt("캠페인/광고그룹/광고를 업데이트 합니다.",["y","n"]);
// if($run != 'y') return false;
CLI::write("캠페인/광고그룹/광고를 업데이트 합니다.", "light_red");
$this->zenith->updateAllByAccounts();
/*
$getAds = $this->zenith->getAds();
$updateAdsets = $this->zenith->updateAdsets($getAds);
$updateCampaigns = $this->zenith->updateCampaigns($updateAdsets);
*/
}
public function updateDB($sdate = null, $edate = null) {
CLI::clearScreen();
if($sdate == null)
$sdate = CLI::prompt("유효DB 업데이트 할 시작날짜를 입력해주세요.", date('Y-m-d'));
if($edate == null)
$edate = CLI::prompt("유효DB 업데이트 할 종료날짜를 입력해주세요.", $sdate);
$sdate = date_create($sdate);
$edate = date_create(date('Y-m-d', strtotime($edate.'+1 days')));
$interval = DateInterval::createFromDateString('1 day');
$date_range = new DatePeriod($sdate, $interval, $edate);
foreach($date_range as $date) {
$date = $date->format('Y-m-d');
CLI::write("{$date} 유효DB를 업데이트 합니다.", "light_red");
$this->zenith->getAdsUseLanding($date);
}
}
public function updateCampaign() {
$campaign_id = CLI::prompt("업데이트 할 캠페인 ID를 입력해주세요.", null);
if(is_null($campaign_id)) return;
$data = [
['campaign_id'=>$campaign_id]
];
$campaign = $this->zenith->updateCampaigns($data);
print_r($campaign);
}
public function updateAds() {
CLI::clearScreen();
// $run = CLI::prompt("광고를 업데이트 합니다.",["y","n"]);
// if($run != 'y') return false;
CLI::write("광고를 업데이트 합니다.", "light_red");
$this->zenith->updateAds();
}
public function updateAdCreatives() {
CLI::clearScreen();
$ad_id = CLI::prompt("업데이트 할 광고 ID를 입력해주세요.", null);
if(is_null($ad_id)) return;
$data = [
['id'=>$ad_id]
];
// $run = CLI::prompt("광고를 업데이트 합니다.",["y","n"]);
// if($run != 'y') return false;
CLI::write("광고소재를 업데이트 합니다.", "light_red");
$adcreative = $this->zenith->updateAdCreatives($data);
print_r($adcreative);
}
}
+121
View File
@@ -0,0 +1,121 @@
<?php
namespace App\Controllers\Advertisement;
use App\Controllers\BaseController;
use App\ThirdParty\googleads_api\ZenithGG;
use CodeIgniter\CLI\CLI;
use Config\Paths;
use DateInterval;
use DatePeriod;
class GoogleAds extends BaseController
{
private $chainsaw;
public function __construct(...$param)
{
$this->chainsaw = new ZenithGG();
}
public function getAccounts()
{
CLI::clearScreen();
CLI::write("광고계정 수신을 진행합니다.", "light_red");
$this->chainsaw->getAccounts();
CLI::write("광고계정 업데이트 완료", "yellow");
}
public function getReports($date=null, $edate=null) {
CLI::clearScreen();
if($date == null)
$date = CLI::prompt("리포트를 수신할 기간 중 시작날짜를 입력해주세요.", date('Y-m-d'));
if($edate == null)
$edate = CLI::prompt("리포트를 수신할 기간 중 종료날짜를 입력해주세요.", $date);
// $run = CLI::prompt("광고데이터를 ".($all=="true"?"포함":"미포함")."하여 {$date} ~ {$edate} 기간의 인사이트를 수신합니다.",["y","n"]);
// if($run != 'y') return false;
$this->chainsaw->getReports($date, $edate);
CLI::write("데이터 수신이 완료되었습니다.", "yellow");
$this->chainsaw->getAdsUseLanding($date);
}
public function getAll()
{
CLI::clearScreen();
CLI::write("계정/계정예산/에셋/캠페인/그룹/소재/보고서 업데이트를 진행합니다.", "light_red");
$result = $this->chainsaw->getAll();
CLI::write("계정/계정예산/에셋/캠페인/그룹/소재/보고서 업데이트 완료", "yellow");
// $paths = new Paths();
// $log_file = fopen($paths->writableDirectory . '/logs/GoogleAdsGetAll.txt', 'a');
// fwrite($log_file, $result . "\r\n\r\n");
// fclose($log_file);
}
public function getAdSchedules() {
$result = $this->chainsaw->getAdSchedules();
}
public function updateDB($sdate = null, $edate = null) {
CLI::clearScreen();
$cliArgs = CLI::getOptions();
$is_result = false;
$ids = [];
if (isset($cliArgs['result'])) {
$is_result = $cliArgs['result'];
}
if (isset($cliArgs['ids'])) {
$ids = $cliArgs['ids'];
}
if($sdate == null) {
$sdate = CLI::prompt("유효DB 업데이트 할 시작날짜를 입력해주세요.", date('Y-m-d'));
}
if($edate == null) {
$edate = CLI::prompt("유효DB 업데이트 할 종료날짜를 입력해주세요.", $sdate);
}
if(!empty($ids)) {
$ids = explode(',', $ids);
}
$sdate = date_create($sdate);
$edate = date_create(date('Y-m-d', strtotime($edate.'+1 days')));
$interval = DateInterval::createFromDateString('1 day');
$date_range = new DatePeriod($sdate, $interval, $edate);
foreach($date_range as $date) {
$date = $date->format('Y-m-d');
CLI::write("{$date} 유효DB를 업데이트 합니다.", "light_red");
$result = $this->chainsaw->getAdsUseLanding($date, $ids);
if($is_result) print_r($result);
}
}
public function getReport() {
$accounts = [
['manageCustomer'=> 7792262348,'customerId'=>4658512480]
];
$this->chainsaw->getReports('2024-05-31', '2024-05-31', $accounts);
}
public function getCampaign() {
$campaigns = $this->chainsaw->getCampaigns('7792262348', '1705230747', '20870581914');
dd($campaigns);
}
public function getCriterion() {
// $campaigns = $this->chainsaw->getCriterions('7792262348', '1705230747', '20870581914');
// $campaigns = $this->chainsaw->getCriterions('7792262348', '8023466215', '20999659346');
$campaigns = $this->chainsaw->getCriterions('7792262348', '9049844350', '20979863645');
dd($campaigns);
}
public function getAdGroups() {
$adgroups = $this->chainsaw->getAdGroups('5980790227', '3931611101', '20581900068');
dd($adgroups);
}
public function getAds() {
$ads = $this->chainsaw->getAds('5980790227', '3288458378', '130392657290', '2023-12-22');
dd($ads);
}
public function getData() {
$getAll = $this->chainsaw->getAll(null, [['manageCustomer'=>7177486093, 'customerId'=>9604111811]]);
dd($getAll);
}
}
@@ -0,0 +1,242 @@
<?php
namespace App\Controllers\Advertisement;
use CodeIgniter\CLI\CLI;
use App\ThirdParty\moment_api\ZenithKM;
use CodeIgniter\Controller;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use DateInterval;
use DatePeriod;
class KakaoMoment extends Controller
{
private $chainsaw;
private $run_proc = [];
public function __construct(...$param)
{
$this->chainsaw = new ZenithKM();
}
public function initController(
RequestInterface $request,
ResponseInterface $response,
LoggerInterface $logger
) {
$uname = php_uname();
if(stripos($uname, 'windows') === false) {
@exec("ps ax | grep -i kmapi | grep -v grep", $exec);
if($exec) {
foreach($exec as $v) $proc[] = preg_replace('/^.+php\skmapi\s(.+)$/', '$1', $v);
foreach($proc as $v) {
$method = preg_replace('/^([a-z]+)\s.+$/i', '$1', $v);
$_params = preg_replace('/^([a-z]+)\s(.+)$/i', '$2', str_replace('\\', '', $v));
$params = explode(' ', $_params);
$this->run_proc = [
'method' => $method,
'params' => $params
];
}
}
}
}
public function oauth() {
return $this->chainsaw->oauth();
}
//토큰 업데이트
public function refresh_token()
{
CLI::clearScreen();
CLI::write("토큰 업데이트를 진행합니다.", "light_red");
$this->chainsaw->refresh_token();
CLI::write("토큰 업데이트 완료", "yellow");
}
//전체 광고계정 업데이트
public function updateAdAccounts()
{
CLI::clearScreen();
CLI::write("전체 광고계정 업데이트를 진행합니다.", "light_red");
$this->chainsaw->updateAdAccounts();
CLI::write("전체 광고계정 업데이트 완료", "yellow");
}
//캠페인 데이터 업데이트
public function updateCampaigns()
{
CLI::clearScreen();
CLI::write("캠페인 업데이트를 진행합니다.", "light_red");
$this->chainsaw->updateCampaigns();
CLI::write("캠페인 업데이트 완료", "yellow");
}
//광고그룹 데이터 업데이트
public function updateAdGroups()
{
CLI::clearScreen();
CLI::write("광고그룹 업데이트를 진행합니다.", "light_red");
$this->chainsaw->updateAdGroups();
CLI::write("광고그룹 업데이트 완료", "yellow");
}
//소재 데이터 업데이트
public function updateCreatives()
{
CLI::clearScreen();
CLI::write("소재 데이터 업데이트를 진행합니다.", "light_red");
$this->chainsaw->updateCreatives();
CLI::write("소재 데이터 업데이트 완료", "yellow");
}
//전체 소재 보고서 BASIC 업데이트
/*
public function updateReportByAdgroup($date = null)
{
CLI::clearScreen();
CLI::write("소재 보고서 업데이트를 진행합니다.", "light_red");
if(is_null($date))
$date = CLI::prompt("전체 소재 보고서 BASIC 수신할 날짜를 입력해주세요.(ex. ".date('Y-m-d', strtotime('-1 day')).")", 'TODAY');
$this->chainsaw->updateCreativesReportBasic($date);
CLI::write("소재 보고서 업데이트 완료", "yellow");
}
*/
public function updateReportByHour($date = null)
{
CLI::clearScreen();
CLI::write("소재 보고서 업데이트를 진행합니다.", "light_red");
if(is_null($date))
$date = CLI::prompt("전체 소재 보고서 BASIC 수신할 날짜를 입력해주세요.(ex. ".date('Y-m-d', strtotime('-1 day')).")", 'TODAY');
$this->chainsaw->updateHourReportBasic($date);
CLI::write("소재 보고서 업데이트 완료", "yellow");
}
public function getAll() {
$this->chainsaw->updateAdAccounts();
$this->chainsaw->updateCampaigns();
$this->chainsaw->updateAdGroups();
$this->chainsaw->updateCreatives();
$this->chainsaw->updateBizform();
}
//비즈폼 데이터 업데이트
public function updateBizform()
{
CLI::clearScreen();
CLI::write("비즈폼 데이터 업데이트를 진행합니다.", "light_red");
$this->chainsaw->updateBizform();
CLI::write("비즈폼 데이터 업데이트 완료", "yellow");
}
//app_subscribe 데이터 업데이트
/* public function moveToAppsubscribe()
{
CLI::clearScreen();
CLI::write("app_subscribe 데이터 업데이트를 진행합니다.", "light_red");
$this->chainsaw->moveToLeads();
CLI::write("app_subscribe 데이터 업데이트 완료", "yellow");
} */
//유효DB 개수 업데이트
public function updateDB($sdate = null, $edate = null) {
CLI::clearScreen();
if($sdate == null)
$sdate = CLI::prompt("유효DB 업데이트 할 시작날짜를 입력해주세요.", date('Y-m-d'));
if($edate == null)
$edate = CLI::prompt("유효DB 업데이트 할 종료날짜를 입력해주세요.", $sdate);
$sdate = date_create($sdate);
$edate = date_create(date('Y-m-d', strtotime($edate.'+1 days')));
$interval = DateInterval::createFromDateString('1 day');
$date_range = new DatePeriod($sdate, $interval, $edate);
foreach($date_range as $date) {
$date = $date->format('Y-m-d');
CLI::write("{$date} 유효DB를 업데이트 합니다.", "light_red");
$result = $this->chainsaw->getCreativesUseLanding($date);
}
}
//리포트데이터를 업데이트
public function updateReportByDate($sdate=null, $edate=null)
{
CLI::clearScreen();
CLI::write("리포트데이터를 업데이트를 진행합니다.", "light_red");
if($sdate == null)
$sdate = CLI::prompt("리포트데이터를 수신할 기간 중 시작날짜를 입력해주세요.", date('Y-m-d'));
if($edate == null)
$edate = CLI::prompt("리포트데이터를 수신할 기간 중 종료날짜를 입력해주세요.", $sdate);
$this->chainsaw->updateReportByDate($sdate, $edate);
CLI::write("리포트데이터 업데이트 완료", "yellow");
}
//소재 자동 변경
public function autoCreativeOnOff()
{
CLI::clearScreen();
CLI::write("소재 자동 변경을 진행합니다.", "light_red");
$check = CLI::prompt("전체 소재 보고서 BASIC 수신할 날짜를 입력해주세요.", ['on', 'off']);
$this->chainsaw->autoCreativeOnOff();
CLI::write("소재 자동 변경 완료", "yellow");
}
//자동 입찰가한도 리셋
public function autoLimitBidAmountReset()
{
CLI::clearScreen();
CLI::write("자동 입찰가한도 리셋을 진행합니다.", "light_red");
$date = CLI::prompt("자동 입찰가한도 리셋할 날짜를 입력해주세요.", date('Y-m-d'));
$this->chainsaw->autoLimitBidAmountReset($date);
CLI::write("자동 입찰가한도 리셋 완료", "yellow");
}
//자동 입찰가 설정
public function autoLimitBidAmount()
{
CLI::clearScreen();
CLI::write("자동 입찰가한도 설정을 진행합니다.", "light_red");
$date = CLI::prompt("자동 입찰가한도 설정할 날짜를 입력해주세요.", date('Y-m-d'));
$this->chainsaw->autoLimitBidAmount($date);
CLI::write("자동 입찰가한도 설정 완료", "yellow");
}
//자동 예산한도 리셋
public function autoLimitBudgetReset()
{
CLI::clearScreen();
CLI::write("자동 예산한도 리셋을 진행합니다.", "light_red");
$date = CLI::prompt("자동 예산한도 리셋할 날짜를 입력해주세요.", date('Y-m-d'));
$this->chainsaw->autoLimitBudgetReset($date);
CLI::write("자동 예산한도 리셋 완료", "yellow");
}
//자동 예산한도 설정
public function autoLimitBudget()
{
CLI::clearScreen();
CLI::write("자동 예산한도 설정을 진행합니다.", "light_red");
$date = CLI::prompt("자동 예산한도 설정할 날짜를 입력해주세요.", date('Y-m-d'));
$this->chainsaw->autoLimitBudget();
CLI::write("자동 예산한도 설정 완료", "yellow");
}
//광고그룹 AI 업데이트
public function setAdGroupsAiRun()
{
CLI::clearScreen();
CLI::write("광고그룹 AI 업데이트를 진행합니다.", "light_red");
$this->chainsaw->setAdGroupsAiRun();
CLI::write("광고그룹 AI 업데이트 완료", "yellow");
}
//AI 자동켜기
public function autoAiOn()
{
CLI::clearScreen();
CLI::write("AI를 시작합니다.", "light_red");
$this->chainsaw->autoAiOn();
CLI::write("AI 시작", "yellow");
}
}