빌더추가 빌더내용출력
컨트롤러경로 : /module/Controller/Front/Goods/GoodsViewController.php
/**
* This is commercial software, only users who have purchased a valid license
* and accept to the terms of the License Agreement can install and use this
* program.
*
* Do not edit or add to this file if you wish to upgrade Godomall5 to newer
* versions in the future.
*
* @copyright ⓒ 2016, NHN godo: Corp.
* @link http://www.godo.co.kr
*/
namespace Controller\Front\Goods;
use Component\Board\Board;
use Component\Board\BoardBuildQuery;
use Component\Board\BoardList;
use Component\Board\BoardWrite;
use Component\Naver\NaverPay;
use Component\Page\Page;
use Component\Promotion\SocialShare;
use Component\Mall\Mall;
use Framework\Debug\Exception\AlertRedirectException;
use Framework\Debug\Exception\Except;
use Framework\Debug\Exception\AlertBackException;
use Component\Validator\Validator;
use Message;
use Globals;
use Request;
use Logger;
use Session;
use Exception;
use Endroid\QrCode\QrCode as EndroidQrCode;
use SocialLinks\Page as SocialLink;
use FileHandler;
use App;
class GoodsViewController extends \Bundle\Controller\Front\Goods\GoodsViewController
{
public $db;
/**
* {@inheritdoc}
*/
public function index()
{
$this->db = \App::load('DB');
$goodsNo = Request::get()->get('goodsNo');
$strSQL = "SELECT externalVimeoFl, externalVimeoUrl FROM es_goods WHERE goodsNo = '$goodsNo' ";
$result = $this->db->query($strSQL);
$data = $this->db->fetch($result);
$this->setData('viemourl', $data['externalVimeoUrl']);
// echo "<pre>";
// print_r($data);exit;
parent::index();
// //DB 호출
// $goods = \App::load('\\Component\\Goods\\Goods');
// $goodsNo = Request::get()->get('goodsNo');
// $data = $goods->getGoodsInfo($goodsNo);
// print_r($data); exit;
// $viemourl = $data['externalVimeoUrl'];
// $this->setData('viemourl', $viemourl);
}
}
파일경로 : /module/Component/Goods/GoodsAdmin.php
<?php
/**
* 상품 class
*
* 상품 관련 관리자 Class
* @author artherot
* @version 1.0
* @since 1.0
* @copyright Copyright (c), Godosoft
*/
namespace Component\Goods;
use Component\Member\Group\Util as GroupUtil;
use Component\Member\Manager;
use Component\Page\Page;
use Component\Storage\Storage;
use Component\Database\DBTableField;
use Component\Validator\Validator;
use Framework\Debug\Exception\HttpException;
use Framework\Debug\Exception\AlertBackException;
use Framework\File\FileHandler;
use Framework\Utility\ImageUtils;
use Framework\Utility\StringUtils;
use Framework\Utility\ArrayUtils;
use Encryptor;
use Globals;
use LogHandler;
use UserFilePath;
use Request;
use Exception;
use Session;
use App;
class GoodsAdmin extends \Bundle\Component\Goods\GoodsAdmin
{
const ECT_INVALID_ARG = 'GoodsAdmin.ECT_INVALID_ARG';
const TEXT_REQUIRE_VALUE = '%s은(는) 필수 항목 입니다.';
const TEXT_USELESS_VALUE = '%s은(는) 사용할 수 없습니다.';
const TEXT_NOT_EXIST_VALUE = '%s 필수 항목이 존재하지 않습니다.';
const TEXT_NOT_EXIST_OPTION = '옵션 항목이 존재하지 않습니다.';
const TEXT_ERROR_VALUE = '조건에 대해 처리중 오류가 발생했습니다.';
const TEXT_ERROR_BATCH = '일괄 처리할 데이터오류로 인해 처리가 되지 않습니다.';
const DEFAULT_PC_CUSTOM_SOLDOUT_OVERLAY_PATH = '/data/icon/goods_icon/custom/soldout_overlay';
const DEFAULT_MOBILE_CUSTOM_SOLDOUT_OVERLAY_PATH = '/data/icon/goods_icon/custom/soldout_overlay_mobile';
public $goodsNo;
public $imagePath;
public $etcIcon;
public $naverConfig;
public $daumConfig;
public $paycoConfig;
protected $goodsGridConfigList; // 상품그리드 디폴트 설정 항목
// 우에 변수설정은 그냥 새파일 추가할때 원래 소스에걸 그대로 가져오면 됨
/**
* 생성자 [이부분은 새(클래스)파일 추가할때 반드시 따라다녀야 됨]
*/
public function __construct()
{
parent::__construct();
}
/**
* 상품 정보 저장 [저장하는 함수 재정의함 원래 코드는 parent::saveInfoGoods($arrData) 이런식으로 호출하면 됨]
*
* @param array $arrData 저장할 정보의 배열
*/
public function saveInfoGoods($arrData)
{
// error_log(print_r($arrData,true),3,'/www/baiwan09151_godomall_com/tmp/res.txt');
//이부분은 원래 saveInfoGoods 실행하는 부분
$res = parent::saveInfoGoods($arrData);
//추가코드 (먼저 추가코드 실행하고 후에 원래코드 실행하거나 반대로 해도 됨.)
$strUpdateSQL = "UPDATE " . DB_GOODS . " SET externalVimeoUrl = '" . $arrData['externalVimeoUrl'] . "' , externalVimeoFl = '" . $arrData['externalVimeoFl'] . "' WHERE goodsNo = '";
$strUpdateSQL .= $this->goodsNo . "' ";
$this->db->query($strUpdateSQL);
// error_log(print_r($strUpdateSQL,true),3,'/www/baiwan09151_godomall_com/tmp/res.txt');
// error_log(print_r($this->goodsNo,true),3,'/www/baiwan09151_godomall_com/tmp/res.txt');
return $res;
}
}
포스터갑 db입력
public function saveInfoGoods($arrData)
{
//추가코드 (먼저 추가코드 실행하고 후에 원래코드 실행하거나 반대로 해도 됨.)
$strUpdateSQL = "UPDATE " . DB_GOODS . " SET externalVimeoUrl = '" . $arrData['externalVimeoUrl'] . "' , externalVimeoFl = '" . $arrData['externalVimeoFl'] . "' WHERE goodsNo = '" . $arrData['goodsNo'] . "' ";
$this->db->query($strUpdateSQL);
//이부분은 원래 saveInfoGoods 실행하는 부분
$res = parent::saveInfoGoods($arrData);
return $res;
}