123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
- <?php
- namespace app\car\controller;
- use app\common\model\User;
- use library\Controller;
- use think\Db;
- class CarFlow extends Controller
- {
-
- protected $table = 'CarFlow';
-
- public function index()
- {
- $this->title = '管理';
- $sel_type = input('sel_type');
- $query = $this->_query($this->table)
- ->alias('f')
- ->field('f.*,u.name,u.headimg')
- ->leftJoin('store_member u','u.id = f.user_id')
- ->order('sort asc,id desc')
- ->where('is_deleted',0)
- ->when($sel_type,function ($query)use ($sel_type){
- if($sel_type) $query->where('type',$sel_type);
- })->page(false);
- }
-
- protected function _index_page_filter(&$data)
- {
- foreach ($data as $k=>&$v){
- }
- }
-
- public function remove()
- {
- $this->_delete($this->table);
- }
-
- public function add(){
- $this->title = '添加';
- $this->_form($this->table, 'form');
- }
-
- public function edit()
- {
- $this->title = '编辑';
- $this->_form($this->table, 'form');
- }
-
- protected function _form_filter(&$data)
- {
- if($this->request->isGet()) {
- $this->all_user = User::where('is_deleted',0)->column('name','id');
- }
- }
- }
|