修改权限和限制核销健壮性

This commit is contained in:
liu 2024-06-06 14:15:42 +08:00
parent 1e06fc9208
commit 04c186afe0
3 changed files with 7 additions and 4 deletions

View File

@ -5,12 +5,10 @@ namespace app\api\controller\order;
use app\api\logic\order\OrderLogic;
use app\api\controller\BaseApiController;
use app\api\lists\order\OrderList;
use app\api\service\WechatUserService;
use app\api\validate\OrderValidate;
use app\common\enum\PayEnum;
use app\common\logic\PaymentLogic;
use app\common\logic\PayNotifyLogic;
use app\common\model\retail\Cashierclass;
use app\common\model\store_order\StoreOrder;
use app\common\model\user\UserAddress;
use Webman\RedisQueue\Redis;
@ -436,6 +434,10 @@ class OrderController extends BaseApiController
public function writeoff_order()
{
$params = (new OrderValidate())->post()->goCheck('check');
$count = StoreOrder::where('verify_code',$params['verify_code'])->count();
if(empty($count)){
return $this->fail('无该核销码请检查');
}
$res = OrderLogic::writeOff($params);
if ($res) {
return $this->success('核销成功');

View File

@ -13,7 +13,7 @@ use support\Response;
#[ApiDoc\title('用户访问')]
class UserVisitController extends BaseApiController
{
public $notNeedLogin = ['productLog'];
#[
ApiDoc\Title('添加访问商品记录'),
ApiDoc\url('/api/user/UserVisit/productLog'),

View File

@ -8,6 +8,7 @@ use app\common\{logic\BaseLogic,
model\finance\CapitalFlow,
model\store_order\StoreOrder,
model\system_store\SystemStore,
model\system_store\SystemStoreStaff,
model\user\User,
model\user\UserRecharge,
model\user\UserShip,
@ -80,7 +81,7 @@ class UserLogic extends BaseLogic
$data['is_staff'] = 0;
$data['store_id'] = 0;
if(isset($data['mobile']) && $data['mobile']){
$check = SystemStore::where('phone',$data['mobile'])->find()??[];
$check = SystemStoreStaff::where('phone',$data['mobile'])->find()??[];
if ($check){
$data['is_staff'] = 1;
$data['store_id'] = $check['store_id'];