12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- namespace app\store\controller;
- use library\Controller;
- use think\Db;
- /**
- * 订单转换
- * Class Order
- * @package app\store\controller
- */
- class OrderShift extends Controller
- {
- protected $table = "OrderShift";
- /**
- * 订单列表
- * @auth true
- * @menu true
- */
- public function index()
- {
- $this->title = '订单转换列表';
- $this->sh_status_desc = ['待审核','审核通过','审核拒绝'];
- $query = $this->_query($this->table);
- if($this->request->request('phone')) $where[]= ['m.phone','like','%'.$this->request->request('phone').'%'];
- if($this->request->request('order_no')) $where[]= ['o.order_no','like','%'.$this->request->request('order_no').'%'];
- $this->sh_status = $this->request->request('sh_status',-1);
- if($this->sh_status > -1 ) $where[]= ['o.sh_status','=',$this->request->request('sh_status')];
- $query->alias('o')
- ->field('o.* ,m.headimg,m.name,m.phone')
- ->join('store_member m',' m.id = o.uid ','LEFT');
- if(!empty($where)) $query->where($where);
- $query ->order('o.sh_status asc ,o.id desc')->page();
- }
- /**
- * 订单审核
- * @auth true
- * @menu true
- */
- public function aduit()
- {
- $this->title = '编辑分类';
- $this->_form($this->table, 'form');
- }
- protected function _form_filter(&$data)
- {
- // 查看
- if($this->request->isGet() && $this->request->action() == 'aduit')
- {
- $this->user = Db::table('store_member')
- ->field('headimg,name,phone')
- ->find($data['uid']);
- }
- // 积分赠送integral_info
- if($this->request->isPost() && $this->request->action() == 'aduit') {
- if($data['sh_status'] == 1 && $data['integral'] && $data['uid']) {
- update_user_integral($data['uid'],$data['integral'],4,'积分转换',$data['id']);
- }
- $data['ck_time'] = date("Y-m-d H:i:s");
- }
- }
- }
|