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.
53 lines
1.8 KiB
PHP
53 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\API;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Yo;
|
|
class LabelController extends Controller
|
|
{
|
|
public function GetLabelList(){
|
|
$query1=DB::table('label')->select('id','type','value','order','img')->whereIn('type',['face','comment'])->where(['status'=>1,'type'=>'face'])->get();
|
|
$query2=DB::table('label')->select('id','type','value','order','img')->whereIn('type',['face','comment'])->where(['status'=>1,'type'=>'comment'])->get();
|
|
return Yo::echo([
|
|
'status' => true,
|
|
'label1'=>$query1,
|
|
'label2'=>$query2,
|
|
]);
|
|
}
|
|
public function GetOrderEvaluate(){ //获取订单是评价详情
|
|
$orderid=request('orderid');
|
|
$orderInfo=DB::select("select a.*,b.name as hname from user_orders as a left join hospitals as b on a.hospital=b.id where a.id=?",[$orderid]);
|
|
$query=DB::table('order_evaluate')->where(['order_id'=>$orderid])->get();
|
|
if(count($query)>0){
|
|
return Yo::echo([
|
|
'status' => true,
|
|
'info'=>$query,
|
|
'orderInfo'=>$orderInfo
|
|
]);
|
|
}else{
|
|
return Yo::echo([
|
|
'status' => false,
|
|
'orderInfo'=>$orderInfo
|
|
]);
|
|
}
|
|
}
|
|
public function AddOrderEvaluate(){ //新增订单评价
|
|
$orderid=request('orderid');
|
|
$faceId=request('faceId');
|
|
$pingjiaList=request('pingjiaList');
|
|
$pingjiaList=implode(',',$pingjiaList);
|
|
$i=DB::table('order_evaluate')->insert(['order_id'=>$orderid,'face_id'=>$faceId,'comment_ids'=>$pingjiaList]);
|
|
if($i){
|
|
$status=true;
|
|
}else{
|
|
$status=false;
|
|
}
|
|
return Yo::echo([
|
|
'status' => $status,
|
|
]);
|
|
}
|
|
}
|