Finished.php 554 B

123456789101112131415161718192021222324
  1. <?php
  2. namespace App\Admin\Actions\Commuinity\Nurse;
  3. use App\Models\Order;
  4. use Encore\Admin\Actions\RowAction;
  5. use Illuminate\Database\Eloquent\Model;
  6. class Finished extends RowAction
  7. {
  8. public $name = '完成';
  9. public function handle(Model $model)
  10. {
  11. $id = $this->row->order_id;
  12. $res = Order::where('id',$id)->update(['order_status'=>Order::FINISHED]);
  13. if($res){
  14. return $this->response()->success('操作成功!')->refresh();
  15. }
  16. return $this->response()->error('操作失败!');
  17. }
  18. }