Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php // +---------------------------------------------------------------------- // | li..
Decoded Output download
<?php
// +----------------------------------------------------------------------
// | likeadminPHP
// +----------------------------------------------------------------------
// |
// | logo
// | giteehttps://gitee.com/likeshop_gitee/likeadmin
// | githubhttps://github.com/likeshop-github/likeadmin
// | https://www.likeadmin.cn
// | likeadmin
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\api\controller;
use app\api\lists\FormCategoryLists;
use app\api\logic\FormCategoryLogic;
use app\api\logic\UserLogic;
use app\api\logic\UserinfoLogic;
use app\api\validate\FormCategoryValidate;
use app\common\model\category\FormCategory;
use app\common\model\form_fieid\FormFieid;
/**
* FormCategory
* Class CategoryController
* @package app\adminapi\controller\category
*/
class CategoryController extends BaseApiController
{
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function lists()
{
return $this->dataLists(new FormCategoryLists());
}
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function flists()
{
$category = FormCategory::where('type', 0)
->field(['id', 'type', 'parent_id', 'category', 'sort'])
->order(['sort' => 'desc'])
->select()
->toArray();
$category_res = array();
foreach ($category as $item){
$fieids = FormFieid::where('category_id', $item['id'])
->order(['sort' => 'desc'])
->select()
->toArray();
$item['fieids'] = $fieids;
array_push($category_res, $item);
}
return $this->data($category_res);
}
/**
* @notes vip
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function vlists()
{
$categorys = FormCategory::where('type', 1)
->where('parent_id', 0)
->field(['id', 'type', 'parent_id', 'category', 'amount', 'sort'])
->order(['sort' => 'desc'])
->select()
->toArray();
$category_res = array();
//
foreach ($categorys as $item){
$category = FormCategory::where('type', 1)
->where('parent_id', $item['id'])
->field(['id', 'type', 'parent_id', 'category', 'amount', 'sort'])
->order(['sort' => 'desc'])
->select()
->toArray();
$item['categorys'] = $category;
array_push($category_res, $item);
}
return $this->data($category_res);
}
/**
* @notes vip
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function getform()
{
$id = $this->request->get('id/d');
$forms = FormFieid::where('category_id', $id)
->field(['id', 'category_id', 'key', 'value', 'field_2', 'sort', 'create_time'])
->order(['sort' => 'desc'])
->select()
->toArray();
return $this->data($forms);
}
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/25 06:41
*/
public function submitdata()
{
$params = $this->request->post();
$user = $this->userInfo;
$userinfo = UserLogic::info($user['user_id']);
$category = FormCategory::where('id', $params['category_id'])
->field(['id', 'amount', 'category', 'type'])
->findOrEmpty();
//
$category_data =[
'id' => $category['id'],
'' => $category['category'],
'' => $category['amount'],
'' => $category['type'] ? 'VIP' : '',
];
$saveParams = [
'' => $category_data,
];
//
if ($category['type'] == 0){
$params_ = $params;
unset($params_['category_id']);
$saveParams[''] = $params_;
$addtableParams =[
'user_id' => $userinfo['id'],
'nickname' => $userinfo['nickname'],
'show_value' => json_encode($saveParams)
];
UserinfoLogic::add($addtableParams);
return $this->success('', [], 1, 1);
}
$flag_amount = $userinfo['user_money'] - $category['amount'];
//
if ($flag_amount <= 0){
return $this->fail('', [], 1, 1);
}
//
$DeductionParams = [
'action' => 2,
'num' => $category['amount'],
'remark' => $category['category'].'',
'user_id' => $userinfo['id'],
'UM_DEC' => 1
];
UserLogic::adjustUserMoney($DeductionParams);;
//
$params_ = $params;
unset($params_['category_id']);
$saveParams[''] = $params_;
$addtableParams =[
'user_id' => $userinfo['id'],
'nickname' => $userinfo['nickname'],
'show_value' => json_encode($saveParams)
];
UserinfoLogic::add($addtableParams);
return $this->success('', [], 1, 1);
}
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function add()
{
$params = (new FormCategoryValidate())->post()->goCheck('add');
$result = FormCategoryLogic::add($params);
if (true === $result) {
return $this->success('', [], 1, 1);
}
return $this->fail(FormCategoryLogic::getError());
}
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function edit()
{
$params = (new FormCategoryValidate())->post()->goCheck('edit');
$result = FormCategoryLogic::edit($params);
if (true === $result) {
return $this->success('', [], 1, 1);
}
return $this->fail(FormCategoryLogic::getError());
}
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function delete()
{
$params = (new FormCategoryValidate())->post()->goCheck('delete');
FormCategoryLogic::delete($params);
return $this->success('', [], 1, 1);
}
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function detail()
{
$params = (new FormCategoryValidate())->goCheck('detail');
$result = FormCategoryLogic::detail($params);
return $this->data($result);
}
} ?>
Did this file decode correctly?
Original Code
<?php
// +----------------------------------------------------------------------
// | likeadminPHP
// +----------------------------------------------------------------------
// |
// | logo
// | giteehttps://gitee.com/likeshop_gitee/likeadmin
// | githubhttps://github.com/likeshop-github/likeadmin
// | https://www.likeadmin.cn
// | likeadmin
// +----------------------------------------------------------------------
// | author: likeadminTeam
// +----------------------------------------------------------------------
namespace app\api\controller;
use app\api\lists\FormCategoryLists;
use app\api\logic\FormCategoryLogic;
use app\api\logic\UserLogic;
use app\api\logic\UserinfoLogic;
use app\api\validate\FormCategoryValidate;
use app\common\model\category\FormCategory;
use app\common\model\form_fieid\FormFieid;
/**
* FormCategory
* Class CategoryController
* @package app\adminapi\controller\category
*/
class CategoryController extends BaseApiController
{
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function lists()
{
return $this->dataLists(new FormCategoryLists());
}
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function flists()
{
$category = FormCategory::where('type', 0)
->field(['id', 'type', 'parent_id', 'category', 'sort'])
->order(['sort' => 'desc'])
->select()
->toArray();
$category_res = array();
foreach ($category as $item){
$fieids = FormFieid::where('category_id', $item['id'])
->order(['sort' => 'desc'])
->select()
->toArray();
$item['fieids'] = $fieids;
array_push($category_res, $item);
}
return $this->data($category_res);
}
/**
* @notes vip
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function vlists()
{
$categorys = FormCategory::where('type', 1)
->where('parent_id', 0)
->field(['id', 'type', 'parent_id', 'category', 'amount', 'sort'])
->order(['sort' => 'desc'])
->select()
->toArray();
$category_res = array();
//
foreach ($categorys as $item){
$category = FormCategory::where('type', 1)
->where('parent_id', $item['id'])
->field(['id', 'type', 'parent_id', 'category', 'amount', 'sort'])
->order(['sort' => 'desc'])
->select()
->toArray();
$item['categorys'] = $category;
array_push($category_res, $item);
}
return $this->data($category_res);
}
/**
* @notes vip
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function getform()
{
$id = $this->request->get('id/d');
$forms = FormFieid::where('category_id', $id)
->field(['id', 'category_id', 'key', 'value', 'field_2', 'sort', 'create_time'])
->order(['sort' => 'desc'])
->select()
->toArray();
return $this->data($forms);
}
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/25 06:41
*/
public function submitdata()
{
$params = $this->request->post();
$user = $this->userInfo;
$userinfo = UserLogic::info($user['user_id']);
$category = FormCategory::where('id', $params['category_id'])
->field(['id', 'amount', 'category', 'type'])
->findOrEmpty();
//
$category_data =[
'id' => $category['id'],
'' => $category['category'],
'' => $category['amount'],
'' => $category['type'] ? 'VIP' : '',
];
$saveParams = [
'' => $category_data,
];
//
if ($category['type'] == 0){
$params_ = $params;
unset($params_['category_id']);
$saveParams[''] = $params_;
$addtableParams =[
'user_id' => $userinfo['id'],
'nickname' => $userinfo['nickname'],
'show_value' => json_encode($saveParams)
];
UserinfoLogic::add($addtableParams);
return $this->success('', [], 1, 1);
}
$flag_amount = $userinfo['user_money'] - $category['amount'];
//
if ($flag_amount <= 0){
return $this->fail('', [], 1, 1);
}
//
$DeductionParams = [
'action' => 2,
'num' => $category['amount'],
'remark' => $category['category'].'',
'user_id' => $userinfo['id'],
'UM_DEC' => 1
];
UserLogic::adjustUserMoney($DeductionParams);;
//
$params_ = $params;
unset($params_['category_id']);
$saveParams[''] = $params_;
$addtableParams =[
'user_id' => $userinfo['id'],
'nickname' => $userinfo['nickname'],
'show_value' => json_encode($saveParams)
];
UserinfoLogic::add($addtableParams);
return $this->success('', [], 1, 1);
}
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function add()
{
$params = (new FormCategoryValidate())->post()->goCheck('add');
$result = FormCategoryLogic::add($params);
if (true === $result) {
return $this->success('', [], 1, 1);
}
return $this->fail(FormCategoryLogic::getError());
}
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function edit()
{
$params = (new FormCategoryValidate())->post()->goCheck('edit');
$result = FormCategoryLogic::edit($params);
if (true === $result) {
return $this->success('', [], 1, 1);
}
return $this->fail(FormCategoryLogic::getError());
}
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function delete()
{
$params = (new FormCategoryValidate())->post()->goCheck('delete');
FormCategoryLogic::delete($params);
return $this->success('', [], 1, 1);
}
/**
* @notes
* @return \think\response\Json
* @author likeadmin
* @date 2024/12/27 05:03
*/
public function detail()
{
$params = (new FormCategoryValidate())->goCheck('detail');
$result = FormCategoryLogic::detail($params);
return $this->data($result);
}
}
Function Calls
None |
Stats
MD5 | 6d1e9053547a02d088432452ad243f22 |
Eval Count | 0 |
Decode Time | 61 ms |