weizong song 3 years ago
parent d05e7411ec
commit 0a6ac0c657

@ -13,6 +13,7 @@ class ProjectForm extends Form
$this->add("longitude", Field::HIDDEN);
$this->add("name", Field::TEXT, ["label" => "名称", "rules" => "required"]);
$this->add("address", Field::TEXT, ["label" => "地址", "rules" => "required"]);
$this->add("percent_first_party", Field::NUMBER, ["label" => "院方结算百分比"]);
$this->add("logo", Field::TEXT, ["label" => "logo", "attr" => ["data-plugin" => "uploader"]]);
$this->add("banners", Field::TEXT, ["label" => "banner", "attr" => ["data-plugin" => "uploader", "data-multiple-multiple" => 1]]);
$this->add("profile", Field::TEXTAREA, ["label" => "简介"]);

@ -505,6 +505,7 @@ class OrdersController extends CommonController
public function cancelOrder($id)
{
$order = (new Orders())->with("orderItems")->find($id);
\Log::info($order);
if ($order->status !== Orders::STATUS_UNCONFIRMED) {
return response()->json([
"errorcode" => 50001,

@ -0,0 +1,30 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateProjectAddPercentFirstParty extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table("project", function (Blueprint $table) {
$table->decimal("percent_first_party", 5, 2)->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

@ -18,6 +18,7 @@
{{$modelName}}
</th>
<th>地址</th>
<th>项目结算比例</th>
<th>操作</th>
</tr>
</thead>
@ -28,6 +29,7 @@
{{ $row->name }}
</td>
<td>{{ $row->address }}</td>
<td>{{ $row->percent_first_party }}</td>
<td>
<a class="btn btn-sm btn-info"
href="{{url("{$urlPrefix}/beds/{$row['id']}")}}"><i class="mdi mdi-bed-empty"></i> 床位管理</a>

@ -35,6 +35,7 @@
<th class="p-1" style="white-space: nowrap">本月退款</th>
<th class="p-1" style="white-space: nowrap">本月结算</th>
<th class="p-1" style="white-space: nowrap">本月未结算余额</th>
<th class="p-1" style="white-space: nowrap">院方结算</th>
</tr>
</thead>
<tbody>
@ -46,6 +47,7 @@
<td>{{ $this_month_balances->filter(function($item) { return $item->belongs_type == "App\Models\Refund"; })->sum("money") }}</td>
<td>{{ $this_month_balances->filter(function($item) { return $item->belongs_type == "App\Models\OrderItems"; })->sum("money") }}</td>
<td>{{ $this_month_balance }}</td>
<td>@if($project->percent_first_party){{ -$this_month_balances->filter(function($item) { return $item->belongs_type == "App\Models\OrderItems"; })->sum("money") * $project->percent_first_party / 100 }}@else{{ "未设置" }}@endif</td>
</tr>
</tbody>
</table>

Loading…
Cancel
Save