Skip to content

Commit

Permalink
t
Browse files Browse the repository at this point in the history
t
  • Loading branch information
wangta69 committed Dec 27, 2024
1 parent 0673937 commit d0ac5f9
Show file tree
Hide file tree
Showing 84 changed files with 376 additions and 414 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ php artisan pondol:create-auth

### 관리자 페이지 접근
```
https://yourdomain/adm
https://yourdomain/admin
```

### 기타 설정
Expand Down
4 changes: 2 additions & 2 deletions src/Console/InstallsBladeStack.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ protected function installBladeStack($type)

\Artisan::call('migrate');

// 연관 패키지의 config 변경
$this->chageOtherConfig();
// 연관 패키지의 config 변경 (수동으로 변경하기)
// $this->chageOtherConfig();

$this->comment('Please execute the "npm install" && "npm run dev" commands to build your assets.');
}
Expand Down
13 changes: 6 additions & 7 deletions src/Http/Controllers/Admin/CancelReturnExchangeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ public function index(Request $request) {

return view('market::admin.cancel-return-exchange.index', [
'items'=>$items,
'return_status' => config('pondol-market.return_status'),
'exchange_status' => config('pondol-market.exchange_status')
'refund_status' => __('market::market.refund_status'),
'exchange_status' => __('market::market.exchange_status')
]);
}

Expand All @@ -90,17 +90,16 @@ public function view($id, Request $request) {
$item->displayOptions = extractOptions($item);



// echo $item->type;
switch($item->type) {
case 'return':
$configs = config('pondol-market.return_status');
case 'refund':
$configs = __('market::market.refund_status');
break;
case 'exchange':
$configs = config('pondol-market.exchange_status');
$configs = __('market::market.exchange_status');
break;
}


return view('market::admin.cancel-return-exchange.view', [
'item'=>$item,
'configs' => $configs,
Expand Down
16 changes: 8 additions & 8 deletions src/Http/Controllers/Admin/Config/BankController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
namespace Pondol\Market\Http\Controllers\Admin\Config;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use DB;
use Illuminate\Support\Facades\Log;

use DB;

use Pondol\Common\Facades\JsonKeyValue;
use Pondol\Market\Models\MarketBank;

use App\Http\Controllers\Controller;

class BankController extends Controller
{
/**
Expand All @@ -26,11 +30,9 @@ public function __construct(
*/
public function index()
{
// config()->set('app.name','My Project App');
// $cat1 = $this->subCategory('');

$banks = MarketBank::where('type', 'manager')->paginate(20)->appends(request()->query());
$codes = config('pondol-market.banks');
$codes = JsonKeyValue::getAsArray('banks');
return view('market::admin.config.bank', [
'banks'=>$banks,
'codes' => $codes
Expand All @@ -39,9 +41,7 @@ public function index()

public function create() {


// [TACKBAE_MONEY] => 1000
$codes = config('pondol-market.banks');
$codes = JsonKeyValue::getAsArray('banks');
return view('market::admin.config.bank-create', [
'codes' => $codes
]);
Expand Down
4 changes: 0 additions & 4 deletions src/Http/Controllers/Admin/Config/CompanyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,9 @@ public function __construct(
*/
public function index()
{


$company = JsonKeyValue::getAsJson('company');
$company->copyright = isset($company->copyright) ? $company->copyright: '';


return view('market::admin.config.company', compact('company'));
}

Expand All @@ -50,7 +47,6 @@ public function update(Request $request) {
'copyright' => $request->copyright,
];

set_config('pondol-market.company', $params );
JsonKeyValue::storeAsJson('company', $params);
return response()->json(['error'=>false]);
}
Expand Down
21 changes: 7 additions & 14 deletions src/Http/Controllers/Admin/Config/DeliveryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
namespace Pondol\Market\Http\Controllers\Admin\Config;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use DB;
use Illuminate\Support\Facades\Log;

use DB;

use Pondol\Common\Facades\JsonKeyValue;

use App\Http\Controllers\Controller;

class DeliveryController extends Controller
{
Expand All @@ -26,13 +29,8 @@ public function __construct(
*/
public function index()
{
// config()->set('app.name','My Project App');
// $cat1 = $this->subCategory('');
// \Artisan::call('config:clear'); // 만약 production mode이고 config를 cache 하여 사용하면
$cfg = config('pondol-market');

return view('market::admin.config.delivery', [
'cfg'=>$cfg
'delivery'=>JsonKeyValue::getAsJson('market.delivery')
]);
}

Expand All @@ -42,12 +40,7 @@ public function update(Request $request) {
'type' => $request->type,
'min' => $request->min
];
// [TACKBAE_MONEY] => 1000
set_config('pondol-market.delivery', $config );


JsonKeyValue::update('market.delivery', $config);
}



}
37 changes: 11 additions & 26 deletions src/Http/Controllers/Admin/Config/PgController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
namespace Pondol\Market\Http\Controllers\Admin\Config;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use DB;
use Illuminate\Support\Facades\Log;
use Pondol\Market\Models\MarketBank;

use DB;

use Pondol\Common\Facades\JsonKeyValue;

use App\Http\Controllers\Controller;
class PgController extends Controller
{
/**
Expand All @@ -26,18 +28,12 @@ public function __construct(
*/
public function index()
{
// config()->set('app.name','My Project App');
// $cat1 = $this->subCategory('');

// $banks = MarketBank::paginate(20)->appends(request()->query());
$payment = config('pondol-market.payment');
$payment = JsonKeyValue::getAsJson('payment');
$pgs = ['inicis'=>'Inicis', 'kcp'=>'KCP', 'lg'=>'LG'];
$simples = ['naver'=>'네이버 페이', 'kakao'=>'카카오 페이']; // simplePayments
return view('market::admin.config.pg', [
'payment' => $payment,
'pgs'=>$pgs,
'simples' => $simples
]);
return view('market::admin.config.pg', compact(
'payment', 'pgs', 'simples'
));
}


Expand All @@ -51,19 +47,8 @@ public function update(Request $request) {
'naver' => $request->naver ? true : false,
'kakao' => $request->kakao ? true : false,
];
Log::info($params);
set_config('pondol-market.payment', $params );

JsonKeyValue::update('payment', $params);
return response()->json(['error'=>false]);
}

// public function destroy(MarketBank $bank, Request $request) {
// $bank->delete();
// return response()->json([
// 'error' => false
// ]);
// // return redirect()->route('market.admin.config.banks');
// }



}
18 changes: 10 additions & 8 deletions src/Http/Controllers/Admin/Config/SmsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
namespace Pondol\Market\Http\Controllers\Admin\Config;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use DB;
use Illuminate\Support\Facades\Log;
use Pondol\Market\Models\MarketBank;

use DB;

use Pondol\Common\Facades\JsonKeyValue;

use App\Http\Controllers\Controller;

class SmsController extends Controller
{
Expand All @@ -27,11 +30,10 @@ public function __construct(
public function index()
{

$sms = config('pondol-market.sms');
$sms = JsonKeyValue::getAsArray('sms');
$vendors = ['smsto'=>'SMS.TO', 'directsend'=>'DIRECTSEND'];

$sms = isset($sms) ? $sms : [];


$sms = array_merge(['vendor'=>null, 'key'=>null, 'id'=>null, 'sender'=>null, 'manager_rec_order'=>false], $sms);

return view('market::admin.config.sms', [
Expand All @@ -48,8 +50,8 @@ public function update(Request $request) {
'sender' => $request->sender,
'manager_rec_order' => $request->manager_rec_order ? true : false
];
Log::info($params);
set_config('pondol-market.sms', $params );

JsonKeyValue::update('market.delivery', $params);
return response()->json(['error'=>false]);
}

Expand Down
47 changes: 11 additions & 36 deletions src/Http/Controllers/Admin/Config/TemplateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
use Storage;

use App\Http\Controllers\Controller;

use Pondol\Common\Facades\JsonKeyValue;

class TemplateController extends Controller
{
Expand Down Expand Up @@ -75,28 +75,14 @@ public function view()
$pages_dir = resource_path('views/market/templates/pages');
$pages = array_map('basename',\File::directories($pages_dir));

$template = config('pondol-market.template');

return view('market::admin.config.template', [
'template'=>$template,
'layouts'=>$layouts,
'main'=>$main,
'shop'=>$shop,
'cart'=>$cart,
'order'=>$order,
'userpage'=>$userpage,
'search'=>$search,
// 'auth'=>$auth,
'components'=>$components,
'mail'=>$mail,
'pages'=>$pages,
]);
$template = JsonKeyValue::getAsArray('market.template');
return view('market::admin.config.template', compact(
'template','layouts','main','shop','cart','order','userpage','search','components','mail','pages'
));
}

public function update(Request $request) {
$template = config('pondol-market.template');

$template['layout']['theme'] = $request->layout;
$template['layouts']['theme'] = $request->layouts;
$template['main']['theme'] = $request->main;
$template['shop']['theme'] = $request->shop;
$template['shop']['theme'] = $request->shop;
Expand All @@ -107,28 +93,22 @@ public function update(Request $request) {
$template['search']['theme'] = $request->search;
$template['search']['lists'] = $request->search_lists;
$template['auth']['theme'] = $request->auth;
$template['component']['theme'] = $request->component;
$template['components']['theme'] = $request->components;
$template['mail']['theme'] = $request->mail;
$template['pages']['theme'] = $request->pages;

set_config('pondol-market.template', $template );
JsonKeyValue::update('market.template', $template);
return response()->json(['error'=>false]);
}

public function updateCI(Request $request) {

$file = $request->file('file');
if($file) {
// $filepath = storage_path('app/public/market');
$filepath = 'public/market';
// $filepath = public_path('storage/market');
$fileName = $file->getClientOriginalName();
// $ext = $file->getClientOriginalExtension();
// $fileName = $name.'.'.$ext;
// $path=\Storage::put($filepath, $file); //

$result = $file->storeAs($filepath, $fileName);
set_config('pondol-market.template.ci', $fileName );
JsonKeyValue::update('market.template', ['ci'=>$fileName]);
}

return redirect()->back();
Expand All @@ -137,17 +117,12 @@ public function updateCI(Request $request) {
public function updateFavicon(Request $request) {
$file = $request->file('file');
if($file) {
// $filepath = storage_path('market');
$filepath = 'public/market';
$fileName = $file->getClientOriginalName();
// $ext = $file->getClientOriginalExtension();
// $fileName = $name.'.'.$ext;
// $path=\Storage::put($filepath, $file); //

$result = $file->storeAs($filepath, $fileName);
set_config('pondol-market.template.favicon', $fileName );
JsonKeyValue::update('market.template', ['favicon'=>$fileName]);
}

// return redirect()->back();
return redirect()->back();
}
}
6 changes: 3 additions & 3 deletions src/Http/Controllers/Admin/Dev/EventController.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function preview(Request $request)
switch($request->type) {
case 'notice':

return view('market.templates.mail.'.config('pondol-market.template.mail.theme').'.'.$request->type, ['mailData'=>$mailData]);
return view(market_theme('mail').'.'.$request->type, ['mailData'=>$mailData]);

break;
case 'order':
Expand All @@ -83,11 +83,11 @@ public function preview(Request $request)
$item->displayOptions = extractOptions($item);
}

return view('market.templates.mail.'.config('pondol-market.template.mail.theme').'.'.$request->type, ['mailData'=>$mailData]);
return view(market_theme('mail').'.'.$request->type, ['mailData'=>$mailData]);
break;
case 'register':

return view('market.templates.mail.'.config('pondol-market.template.mail.theme').'.'.$request->type, ['mailData'=>$mailData]);
return view(market_theme('mail').'.'.$request->type, ['mailData'=>$mailData]);
break;

}
Expand Down
Loading

0 comments on commit d0ac5f9

Please sign in to comment.