|
@@ -4,6 +4,7 @@ namespace App\Community\Controllers;
|
|
|
|
|
|
use App\Admin\Actions\Community\Docter\Chat;
|
|
use App\Admin\Actions\Community\Docter\Chat;
|
|
use App\Admin\Actions\Community\Notice\sendNotice;
|
|
use App\Admin\Actions\Community\Notice\sendNotice;
|
|
|
|
+use App\Admin\Actions\Community\Order\Detail;
|
|
use App\Models\Docter;
|
|
use App\Models\Docter;
|
|
use App\Models\Order;
|
|
use App\Models\Order;
|
|
use Encore\Admin\Controllers\AdminController;
|
|
use Encore\Admin\Controllers\AdminController;
|
|
@@ -33,15 +34,13 @@ class DocterChatController extends AdminController
|
|
$grid = new Grid(new Order());
|
|
$grid = new Grid(new Order());
|
|
|
|
|
|
$user = Admin::user();
|
|
$user = Admin::user();
|
|
|
|
+ $org_id = $user->org_id;
|
|
|
|
+ $docter_id = $user->docter_id;
|
|
$is_admin = Admin::user()->inRoles(['administrator','devloper']);
|
|
$is_admin = Admin::user()->inRoles(['administrator','devloper']);
|
|
$grid->batchActions(function ($batch) {
|
|
$grid->batchActions(function ($batch) {
|
|
$batch->add(new sendNotice());
|
|
$batch->add(new sendNotice());
|
|
});
|
|
});
|
|
if(!$is_admin){
|
|
if(!$is_admin){
|
|
- $org_id = $user->org_id;
|
|
|
|
- $docter_id = $user->docter_id;
|
|
|
|
-
|
|
|
|
-
|
|
|
|
$grid->model()->whereHas('orders',function ($query) use ($org_id,$docter_id) {
|
|
$grid->model()->whereHas('orders',function ($query) use ($org_id,$docter_id) {
|
|
$where['organization_id']=$org_id;
|
|
$where['organization_id']=$org_id;
|
|
if($docter_id){
|
|
if($docter_id){
|
|
@@ -57,8 +56,11 @@ class DocterChatController extends AdminController
|
|
$grid->column('orderPatient.birthday', __('患者年龄'))->display(function ($w){
|
|
$grid->column('orderPatient.birthday', __('患者年龄'))->display(function ($w){
|
|
return birthday_to_age($w);
|
|
return birthday_to_age($w);
|
|
});
|
|
});
|
|
- $grid->actions(function ($actions){
|
|
|
|
- $actions->add( new Chat());
|
|
|
|
|
|
+ $grid->actions(function ($actions) use($docter_id) {
|
|
|
|
+ if($docter_id){
|
|
|
|
+ $actions->add( new Chat());
|
|
|
|
+ }
|
|
|
|
+ $actions->add(new Detail());
|
|
$actions->disableDelete();
|
|
$actions->disableDelete();
|
|
$actions->disableView();
|
|
$actions->disableView();
|
|
$actions->disableEdit();
|
|
$actions->disableEdit();
|
|
@@ -81,26 +83,7 @@ class DocterChatController extends AdminController
|
|
*/
|
|
*/
|
|
protected function detail($id)
|
|
protected function detail($id)
|
|
{
|
|
{
|
|
- $show = new Show(Order::findOrFail($id));
|
|
|
|
-
|
|
|
|
- $show->field('id', __('Id'));
|
|
|
|
- $show->field('user_id', __('User id'));
|
|
|
|
- $show->field('docter_id', __('Docter id'));
|
|
|
|
- $show->field('patient_id', __('Patient id'));
|
|
|
|
- $show->field('organization_id', __('Organization id'));
|
|
|
|
- $show->field('order_sn', __('Order sn'));
|
|
|
|
- $show->field('payment_type', __('Payment type'));
|
|
|
|
- $show->field('product_type', __('Product type'));
|
|
|
|
- $show->field('order_status', __('Order status'));
|
|
|
|
- $show->field('payment_status', __('Payment status'));
|
|
|
|
- $show->field('total_amount', __('Total amount'));
|
|
|
|
- $show->field('payment_amount', __('Payment amount'));
|
|
|
|
- $show->field('discount_amount', __('Discount amount'));
|
|
|
|
- $show->field('payment_time', __('Payment time'));
|
|
|
|
- $show->field('created_at', __('Created at'));
|
|
|
|
- $show->field('updated_at', __('Updated at'));
|
|
|
|
-
|
|
|
|
- return $show;
|
|
|
|
|
|
+ return '';
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -110,24 +93,23 @@ class DocterChatController extends AdminController
|
|
*/
|
|
*/
|
|
protected function form()
|
|
protected function form()
|
|
{
|
|
{
|
|
-
|
|
|
|
- $content = new Content();
|
|
|
|
- $form = new Form();
|
|
|
|
- $user = Admin::user();
|
|
|
|
- $org_id = $user->org_id;
|
|
|
|
- $docter_id = $user->docter_id;
|
|
|
|
- $form->setView('chat');
|
|
|
|
- return $form;
|
|
|
|
|
|
+ return '';
|
|
}
|
|
}
|
|
|
|
|
|
function chats(Content $content){
|
|
function chats(Content $content){
|
|
- $content->title('儿保排班');
|
|
|
|
- $content->description('医生用户可以接受接受预约');
|
|
|
|
|
|
+ $content->title('咨询订单 ');
|
|
|
|
+ $content->description('医生用户可以接受预约');
|
|
$user = Admin::user();
|
|
$user = Admin::user();
|
|
$org_id = $user->org_id;
|
|
$org_id = $user->org_id;
|
|
$docter_id = $user->docter_id;
|
|
$docter_id = $user->docter_id;
|
|
- $content->view('chat',['docter_id'=>$docter_id]);
|
|
|
|
|
|
+ $content->body('<iframe src="/cdms/chat_view" style="width: 100%;height:800px;border: none"></iframe>');
|
|
return $content;
|
|
return $content;
|
|
- return view('chat', ['data' =>'foo']);
|
|
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public function chat_view()
|
|
|
|
+ {
|
|
|
|
+ return view('cdms.chat');
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|