index.blade.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. @extends('admin.public.base')
  2. @section('body_class')
  3. style="margin: 0 auto;width: 96%;padding: 30px 0px;"
  4. @endsection
  5. @section('content')
  6. <div class="page-header">
  7. <a href="{{url('admin/product/add')}}" class="btn btn-primary">新增</a>
  8. </div>
  9. <form action="" method="get" class="form-horizontal form-line">
  10. <div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-2" style="margin-right: 2px;">
  11. <input type="text" class="form-control" name="product_code" value="{{request('product_code','')}}" placeholder="请输入产品编码查询" />
  12. </div>
  13. <div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-2" style="margin-right: 2px;">
  14. <input type="text" class="form-control" name="name" value="{{request('name','')}}" placeholder="请输入产品名称查询" />
  15. </div>
  16. <div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-2" style="margin-right: 2px;">
  17. <select name="status" class="form-control">
  18. <option value="" >产品状态</option>
  19. <option value="0" @if (request('status') === '0' ) selected="selected" @endif >已上架</option>
  20. <option value="1" @if (request('status') === '1' ) selected="selected" @endif >已下架</option>
  21. </select>
  22. </div>
  23. <div class="form-group col col-lg-2 col-md-2 col-sm-2 col-xs-2" style="margin-right: 2px;">
  24. <input type="date" class="form-control" name="start_time" value="{{request('start_time','')}}" placeholder="请输入创建时间查询" />
  25. </div>
  26. <input type="submit" class="btn btn-sm btn-primary" value="查询"/>
  27. <a href="{{url('admin/product/index')}}" class="btn btn-sm btn-default" >重置</a>
  28. </form>
  29. <div class="row">
  30. <div class="col-xs-12">
  31. <div class="table-responsive">
  32. <table class="table table-striped table-bordered table-hover">
  33. <thead>
  34. <tr>
  35. <th>产品编码</th>
  36. <th>产品名称</th>
  37. <th>规格</th>
  38. <th>产品价格</th>
  39. <th>产品库存</th>
  40. <th>产品状态</th>
  41. <th>生产厂家</th>
  42. <th>创建人</th>
  43. <th>创建时间</th>
  44. <th>操作</th>
  45. </tr>
  46. </thead>
  47. <tbody>
  48. @foreach ($list as $a)
  49. <tr>
  50. <td> {{$a['product_code']}}</td>
  51. <td> {{$a['name']}}</td>
  52. <td> {{$a['spec']}}</td>
  53. <td> ¥<del>{{$a['market_price']}}</del> ¥{{$a['price']}}</td>
  54. <td> {{$a['stock']}} </td>
  55. <td> {{$a['status']?'已下架':'已上架'}} </td>
  56. <td> {{$a['producer_name']}}</td>
  57. <td> {{$a['admin_name']}}</td>
  58. <td> {{date('Y/m/d H:i:s',$a['insert_time'])}}</td>
  59. <td>
  60. <a class="btn btn-sm btn-warning" href="{{url('admin/product/edit?'.http_build_query(['id'=>$a['id']]))}}" title="查看">
  61. 编辑
  62. </a>
  63. @if ($a['status'])
  64. <a class="delete btn btn-sm btn-success" data-url="{{url('admin/product/set_status?'.http_build_query(['id'=>$a['id'],'status'=>'0']))}}">
  65. 上架
  66. </a>
  67. @else
  68. <a class="delete btn btn-sm btn-danger" data-url="{{url('admin/product/set_status?'.http_build_query(['id'=>$a['id'],'status'=>'1']))}}">
  69. 下架
  70. </a>
  71. @endif
  72. </td>
  73. </tr>
  74. @endforeach
  75. <tr>
  76. <td colspan="20" class="page">{{$list->render()}}</td>
  77. </tr>
  78. <tr>
  79. <td colspan="20">总计 {{$list->total()}} 个产品</td>
  80. </tr>
  81. </tbody>
  82. </table>
  83. </div>
  84. </div>
  85. </div>
  86. @endsection