| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <?php
- namespace App\Http\Controllers\Config;
- use App\Http\Controllers\AdminBaseController;
- use App\Models\ExpenseMoney;
- use App\Models\OrderAccountsSet;
- use App\Repositories\Eloquent\ConfigRepositoryEloquent;
- use App\Servers\CommonServer;
- use App\Validators\ConfigValidator;
- use App\Http\Requests\ConfigUpdateRequest;
- use App\Models\Config;
- use App\Models\ShopSet;
- use Prettus\Validator\Exceptions\ValidatorException;
- /**
- * Class CommentTagsController.
- *
- * @package namespace App\Http\Controllers;
- */
- class ConfigsController extends AdminBaseController
- {
- protected $repository;
- protected $validator;
- /**
- * CommentTagsController constructor.
- *
- */
- public function __construct(ConfigRepositoryEloquent $repository, ConfigValidator $validator)
- {
- parent::__construct($repository, $validator);
- }
- /**
- * Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
- */
- public function index_new()
- {
- $configs=Config::whereIn('key',['usdt','lucky'])->pluck('value','key');
- return view('admins.configs.index',['configs'=>$configs]);
- }
- function use_expense(){
- if(request()->isMethod('post')){
- $data=request()->all();
- if(isset($data['_token']))unset($data['_token']);
- ExpenseMoney::where('id',1)->update($data);
- return $this->response(self::SUCCESS_MSG,'success','',route('admin.config.on_order_set'));
- }else{
- $configs=ExpenseMoney::where('id',1)->first();
- return view('admins.configs.use_expense',['configs'=>$configs]);
- }
- }
- /**
- * Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
- */
- public function about_us()
- {
- $configs=Config::whereIn('key',['about_us','privacy_protocol'])->pluck('value','key');
- return view('admins.configs.about_us',['configs'=>$configs]);
- }
- /**
- * Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
- */
- public function agreement()
- {
- $configs=Config::where('key','agreement')->pluck('value','key');
- return view('admins.configs.agreement',['configs'=>$configs]);
- }
- /**
- * Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
- */
- public function beans()
- {
- $configs=Config::where('key','beans')->pluck('value','key');
- return view('admins.configs.beans',['configs'=>$configs]);
- }
- /**
- * Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
- */
- public function order_set()
- {
- $configs=Config::whereIn('key',['order_affirm','order_finish'])->pluck('value','key');
- return view('admins.configs.order_set',['configs'=>$configs]);
- }
- function consume(){
- $configs=Config::whereIn('key',['consume_money','consume_for','consume_give'])->pluck('value','key');
- return view('admins.configs.consume',['configs'=>$configs]);
- }
- /**
- * Display a listing of the resource.
- *
- * @return \Illuminate\Http\Response
- */
- public function indexDown()
- {
- $configs=Config::pluck('value','key');
- return view('admins.configs.indexDown',['configs'=>$configs]);
- }
- function update_new1(){
- foreach ( request()->all() as $key => $value ){
- // 查找当前数据是否存在
- if( Config::where('key', $key)->where('value', $value)->count() ){ continue; }
- Config::where('key', $key)->update([ 'value' => $value ]);
- }
- return $this->response(self::SUCCESS_MSG,'success','');
- }
- }
|