You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.5 KiB
PHP
52 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API\Admin\YeWu;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\DB;
|
|
|
|
class OrderController extends Controller
|
|
{
|
|
public function GetList()
|
|
{
|
|
$page = request('page');
|
|
$pageSize = request('pageSize');
|
|
$searchInfo = request('searchInfo');
|
|
$list=DB::table('orders');
|
|
if(isset($searchInfo['name'])){
|
|
$list = $list->where('name', 'like', '%' . $searchInfo['name'] . '%');
|
|
}
|
|
if(isset($searchInfo['id_number'])){
|
|
$list = $list->where('id_number', $searchInfo['id_number'] );
|
|
}
|
|
if(isset($searchInfo['order_number'])){
|
|
$list = $list->where('order_number', $searchInfo['order_number'] );
|
|
}
|
|
$count=$list->count();
|
|
$list=$list->orderBy('id','desc')
|
|
->skip(($page-1)*$pageSize) // 跳过前9999条记录
|
|
->take($pageSize)->get();
|
|
return \Yz::Return(true,"查询完成",['list'=>$list,'count'=>$count]);
|
|
}
|
|
public function GetDetail()
|
|
{
|
|
$id = request('id');
|
|
$order=DB::table('orders')->where(['id'=>$id])->first();
|
|
return \Yz::Return(true,"查询完成",['info'=>$order]);
|
|
}
|
|
public function Save()
|
|
{
|
|
$info = request('info');
|
|
$date=[
|
|
'note'=>$info['note']
|
|
];
|
|
$u=DB::table('orders')->where(['id'=>$info['id']])->update($date);
|
|
if($u){
|
|
return \Yz::Return(true,"操作完成",[]);
|
|
}else{
|
|
return \Yz::echoError1("保存失败");
|
|
}
|
|
}
|
|
}
|