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 /** * The file was created by Assimon. * * @author assimon<[email protected]> * ..
Decoded Output download
<?php
/**
* The file was created by Assimon.
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
namespace App\Service;
use App\Models\Coupon;
class CouponService
{
/**
*
*
* @param string $coupon
* @param int $goodsID id
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object|null
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function withHasGoods(string $coupon, int $goodsID)
{
$coupon = Coupon::query()->whereHas('goods', function ($query) use ($goodsID) {
$query->where('goods_id', $goodsID);
})->where('is_open', Coupon::STATUS_OPEN)->where('coupon', $coupon)->first();
return $coupon;
}
/**
*
* @param string $coupon
* @return bool
*/
public function used(string $coupon): bool
{
return Coupon::query()
->where('coupon', $coupon)
->update(['is_use' => Coupon::STATUS_USE]);
}
/**
* -1
* @param string $coupon
* @return int
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function retDecr(string $coupon)
{
return Coupon::query()
->where('coupon', $coupon)
->decrement('ret', 1);
}
/**
* +1
*
* @param int $id
* @return int
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function retIncrByID(int $id)
{
return Coupon::query()->where('id', $id)->increment('ret', 1);
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* The file was created by Assimon.
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
namespace App\Service;
use App\Models\Coupon;
class CouponService
{
/**
*
*
* @param string $coupon
* @param int $goodsID id
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object|null
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function withHasGoods(string $coupon, int $goodsID)
{
$coupon = Coupon::query()->whereHas('goods', function ($query) use ($goodsID) {
$query->where('goods_id', $goodsID);
})->where('is_open', Coupon::STATUS_OPEN)->where('coupon', $coupon)->first();
return $coupon;
}
/**
*
* @param string $coupon
* @return bool
*/
public function used(string $coupon): bool
{
return Coupon::query()
->where('coupon', $coupon)
->update(['is_use' => Coupon::STATUS_USE]);
}
/**
* -1
* @param string $coupon
* @return int
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function retDecr(string $coupon)
{
return Coupon::query()
->where('coupon', $coupon)
->decrement('ret', 1);
}
/**
* +1
*
* @param int $id
* @return int
*
* @author assimon<[email protected]>
* @copyright assimon<[email protected]>
* @link http://utf8.hk/
*/
public function retIncrByID(int $id)
{
return Coupon::query()->where('id', $id)->increment('ret', 1);
}
}
Function Calls
None |
Stats
MD5 | 0f2a159c85b8250a87c26fb59ac437e0 |
Eval Count | 0 |
Decode Time | 110 ms |