Commit 470c9c93 by lizhilin

更新

parent 690278f5
...@@ -27,7 +27,11 @@ protected function grid() ...@@ -27,7 +27,11 @@ protected function grid()
{ {
return Grid::make(new ModelsCovenantReceivePayment(), function (Grid $grid) { return Grid::make(new ModelsCovenantReceivePayment(), function (Grid $grid) {
$cid = $grid->model()->filter()->input('cid') ?? 0; $cid = $grid->model()->filter()->input('cid') ?? 0;
$lawyer_id = 0;
if ($cid) {
$cobj = ModelsCovenant::find($cid);
$lawyer_id = $cobj->lawyer_id;
}
if (Admin::user()->can('view-invoiced-add')) { if (Admin::user()->can('view-invoiced-add')) {
$grid->tools(function (Grid\Tools $tools) use ($cid) { $grid->tools(function (Grid\Tools $tools) use ($cid) {
$tools->append(Modal::make() $tools->append(Modal::make()
...@@ -41,7 +45,7 @@ protected function grid() ...@@ -41,7 +45,7 @@ protected function grid()
->body(CovenantInvoiceForm::make()->payload(['id' => $cid]))); ->body(CovenantInvoiceForm::make()->payload(['id' => $cid])));
}); });
} }
$grid->model()->where('rtype', 2)->orderBy("id", "desc"); $grid->model()->where('lawyer_id', $lawyer_id)->where('rtype', 2)->orderBy("id", "desc");
//$grid->column('id')->sortable(); //$grid->column('id')->sortable();
$grid->column('invoiced_at', '开票时间'); $grid->column('invoiced_at', '开票时间');
$grid->column('invoiced_money', '开票金额'); $grid->column('invoiced_money', '开票金额');
......
...@@ -29,7 +29,11 @@ protected function grid() ...@@ -29,7 +29,11 @@ protected function grid()
{ {
return Grid::make(new ModelsCovenantReceivePayment(), function (Grid $grid) { return Grid::make(new ModelsCovenantReceivePayment(), function (Grid $grid) {
$cid = $grid->model()->filter()->input('cid') ?? 0; $cid = $grid->model()->filter()->input('cid') ?? 0;
$lawyer_id = 0;
if ($cid) {
$cobj = ModelsCovenant::find($cid);
$lawyer_id = $cobj->lawyer_id;
}
$grid->tools(function (Grid\Tools $tools) use ($cid) { $grid->tools(function (Grid\Tools $tools) use ($cid) {
if (Admin::user()->can('view-received-add')) { if (Admin::user()->can('view-received-add')) {
...@@ -46,7 +50,7 @@ protected function grid() ...@@ -46,7 +50,7 @@ protected function grid()
}); });
$grid->model()->where('rtype', 1)->orderBy("id", "desc"); $grid->model()->where('lawyer_id', $lawyer_id)->where('rtype', 1)->orderBy("id", "desc");
//$grid->column('id')->sortable(); //$grid->column('id')->sortable();
$grid->column('received_type', '收款账户')->display(function ($val) { $grid->column('received_type', '收款账户')->display(function ($val) {
return $val == 1 ? '基本户' : '其它'; return $val == 1 ? '基本户' : '其它';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment