12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <?php
- namespace app\mobile\controller;
- use app\common\model\BrokerIncome as BrokerIncomeModel;
- use app\mobile\MobileBaseController;
- use think\App;
- use think\facade\View;
- class My extends MobileBaseController
- {
- private $_broker = null;
- public function __construct(App $app)
- {
- parent::__construct($app);
- $this->_broker = get_broker();
- View::assign('broker', $this->_broker);
- }
- /**
- * 个人中心
- */
- public function index()
- {
- return view('my/index');
- }
- /**
- * 收益明细
- */
- public function income()
- {
- $data = [];
- //上月收益
- $month_time = date('Ym', strtotime('-1 month'));
- $month_income = BrokerIncomeModel::where(['monthtime' => $month_time, 'brokerid' => $this->_broker['id']])->sum('value');
- $data['month_income'] = $month_income;
- return view('my/income', $data);
- }
- /**
- * 收益明细列表
- */
- public function listIncome()
- {
- $map = $this->dealEqualInput(['cate_id']);
- $map[] = ['brokerid', '=', $this->_broker['id']];
- $list = BrokerIncomeModel::where($map)
- ->order(['id' => 'desc'])
- ->limit(input('limit', 10))
- ->page(input('page', 1))
- ->append(['status_text'])
- ->select();
- ajax_success($list);
- }
- /**
- * 推广码
- */
- public function qrcode()
- {
- error_reporting(E_ERROR);
- $url = request()->domain(true) . '/mobile/candidate/info?broker_id=' . $this->_broker['id'];
- header('Content-Type: image/png');
- ob_clean();
- $errorCorrectionLevel = "L"; // 纠错级别:L、M、Q、H
- $matrixPointSize = "4"; //生成图片大小 :1到10
- \phpqrcode\QRcode::png($url, false, $errorCorrectionLevel, $matrixPointSize);
- exit();
- }
- }
|