12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- <?php
- namespace app\order\controller;
- use library\Controller;
- use think\Db;
- /**
- * 元石提现管理
- * Class CrystalCash
- * @package app\order\controller
- */
- class CrystalCash extends Controller
- {
- protected $table = 'CrystalOrder';
- /**
- * 充值订单
- * @auth true
- * @menu true
- */
- public function index()
- {
- $this->title = '充值订单';
- $this->order_status = ['待支付','已支付'];
- $query = $this->_query($this->table);
- $where = [];
- if($this->request->request('tel'))$where[]= ['u.phone','like','%'.$this->request->request('tel').'%'];
- if($this->request->request('user_name'))$where[]= ['u.name','like','%'.$this->request->request('user_name').'%'];
- if($this->request->request('order_no')) $where[]= ['o.order_no','like','%'.$this->request->request('order_no').'%'];
- if($this->request->request('order_status') > -1) $where[]= ['o.status','=',$this->request->request('order_status')];
- $query->alias('o')
- ->field('o.* , u.name as user_name ,u.phone')
- ->join('store_member u',' o.uid = u.id ','LEFT');
- if(!empty($where)) $query->where($where);
- $query ->order('o.id desc')->page();
- }
- /**
- * 订单详情
- * @auth true
- * @menu true
- */
- public function detail()
- {
- $this->title = '订单详情';
- $order_id = input('id');
- $detail = Db::table('crystal_order o')
- ->field('o.* , u.name as user_name ,u.phone')
- ->join('store_member u',' o.uid = u.id ','LEFT')
- ->where('o.id',$order_id)
- ->find();
- $this->assign('detail',$detail);
- $this->fetch('detail');
- }
- /**
- * 表单数据处理
- * @auth true
- * @menu true
- * @param array $data
- */
- protected function _form_filter(&$data)
- {
- if ($this->request->isPost() && $this->request->action() == 'deliver') {
- $express_company = Db::table('store_express_company')->field('id,express_title')->find($data['express_company_id']);
- $data['express_company_title'] = $express_company['express_title'] ? $express_company['express_title'] : '';
- $data['express_send_at'] = date("Y-m-d H:i:s");
- $data['express_state'] = 1;
- }
- }
- }
|