url认证
This commit is contained in:
31
app/api/controller/Allow.php
Normal file
31
app/api/controller/Allow.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\controller;
|
||||
|
||||
use app\api\model\ManagerPermission;
|
||||
|
||||
class Allow
|
||||
{
|
||||
public function urlCheck()
|
||||
{
|
||||
$manager_model = new ManagerPermission;
|
||||
$get = $_GET;
|
||||
|
||||
$allow_ids = ['993','282'];
|
||||
|
||||
if(!in_array($get['id'],$allow_ids)){
|
||||
//获取
|
||||
$info = $manager_model->field('*')
|
||||
->join('manager_permission_map ON manager_permission_map.PermissionCode=manager_permission.PermissionCode')
|
||||
->where(['PermissionUrl' => $get['url'],'ManagerId'=>$get['id']])
|
||||
->fetch();
|
||||
} else {
|
||||
result([], '', 10000);die;
|
||||
}
|
||||
|
||||
if(!$info){
|
||||
result([], '', -10000);die;
|
||||
}
|
||||
result([], '', 10000);die;
|
||||
}
|
||||
}
|
||||
12
app/api/model/ManagerPermission.php
Normal file
12
app/api/model/ManagerPermission.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\model;
|
||||
|
||||
use fastphp\base\Model;
|
||||
|
||||
class ManagerPermission extends Model
|
||||
{
|
||||
protected $table = 'manager_permission';
|
||||
|
||||
|
||||
}
|
||||
12
app/api/model/ManagerPermissionMap.php
Normal file
12
app/api/model/ManagerPermissionMap.php
Normal file
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace app\api\model;
|
||||
|
||||
use fastphp\base\Model;
|
||||
|
||||
class ManagerPermissionMap extends Model
|
||||
{
|
||||
protected $table = 'manager_permission_map';
|
||||
|
||||
|
||||
}
|
||||
@@ -32,4 +32,29 @@ class Order extends Controller
|
||||
// \exportToCsv('test.csv',['id','淘宝id','淘宝会员名','退款金额','子订单编号','交易编号','无关变量','无关变量','产品','申请时间','用户名','处理时间','备注','状态','扣除前余额','处理人','扣除后余额'],$list);
|
||||
}
|
||||
|
||||
//认领的订单数
|
||||
public function takeOrderNum()
|
||||
{
|
||||
$get = $_GET;
|
||||
$order_model = new OrderModel;
|
||||
$date1 = date('Y-m-d',time());
|
||||
$date2 = date("Y-m-d H:i:s", time());
|
||||
if (!empty($get['Btime'])) {
|
||||
$date1 = date('Y-m-d', strtotime($get['Btime']));
|
||||
$date2 = date("Y-m-d 23:59:59", strtotime($get['Etime']));
|
||||
}
|
||||
|
||||
$info = $order_model
|
||||
->field('count(1) as num')
|
||||
->where(['Channel'=>$this->userinfo['LoginName']])
|
||||
->where("CreateTime>'".$date1."' AND CreateTime<'".$date2."'")
|
||||
->fetch();
|
||||
$data = [
|
||||
'Code' => 10000,
|
||||
'Message' => '',
|
||||
'num' => $info['num']
|
||||
];
|
||||
echo json_encode($data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user