shoppingmallv2 init...

This commit is contained in:
최준흠 2023-07-31 19:26:26 +09:00
parent a01793a50a
commit 3439bbfb94
3 changed files with 14 additions and 14 deletions

View File

@ -35,13 +35,13 @@ abstract class BaseBackend
}
//transaction관련
final public function transBegin()
final public function transStart($isTest = false)
{
$this->_model->transBegin();
$this->_model->transStart($isTest);
}
final public function transCommit()
final public function transComplete()
{
$this->_model->transBegin();
$this->_model->transComplete();
}
final public function transRollback()
{

View File

@ -22,20 +22,20 @@ class OrderController extends AdminController
$msg = "";
try {
$this->_viewDatas = $this->init(__FUNCTION__);
//Transaction manully 시작
// $this->_backend->transBegin();
//Transaction 시작
$this->_backend->transStart();
$this->insert_process();
$entity = $this->_backend->insert($this->_viewDatas['fieldDatas']);
//Transaction manully Commit
// $this->_backend->transCommit();
//Transaction Commit
$this->_backend->transCommit();
$msg = sprintf(
"%s에서 해당 상품 %s개를 장바구니에 담았습니다.",
$this->_viewDatas['title'],
$this->_viewDatas['fieldDatas']['quantity']
);
} catch (\Exception $e) {
//Transaction manully Rollback
// $this->_backend->transRollback();
//Transaction Rollback
$this->_backend->transRollback();
$msg = sprintf(
"%s에서 다음 오류로 인해 장바구니에 담기를 실패하였습니다.\n%s",
$this->_viewDatas['title'],

View File

@ -311,8 +311,8 @@ abstract class BaseController extends Controller
$uids = $this->request->getVar('batchjob_uids') ?: throw new \Exception($this->_viewDatas['title'] . '에서 변경할 항목(uid)이 선택되지 않았습니다.');
$cnt = 1;
//Transaction manully 시작
$this->_backend->transBegin();
//Transaction 시작
$this->_backend->transStart();
foreach ($uids as $uid) {
try {
$entity = $this->_viewDatas['entity'] = $this->_backend->getEntity($uid);
@ -324,7 +324,7 @@ abstract class BaseController extends Controller
}
$cnt++;
}
//Transaction manully Commit
//Transaction Commit
$this->_backend->transCommit();
$msg = sprintf(
"%s에서 총:%s개의 %s 완료하였습니다.",
@ -333,7 +333,7 @@ abstract class BaseController extends Controller
__FUNCTION__
);
} catch (\Exception $e) {
//Transaction manully Rollback
//Transaction Rollback
$this->_backend->transRollback();
log_message('error', sprintf("---------batchjob 작업결과--------\n%s\n", implode("\n", $batchjobs)));
return sprintf(