57 lines
1.4 KiB
PHP
Executable File
57 lines
1.4 KiB
PHP
Executable File
<?php
|
|
|
|
namespace app\admin\controller;
|
|
|
|
use app\admin\controller\Base;
|
|
use \think\Request;
|
|
use think\facade\View;
|
|
use app\common\model\CouponReceive as CouponReceiveModel;
|
|
use app\common\model\GoodsList;
|
|
use app\common\model\GoodsCate;
|
|
use app\common\model\GoodsSku;
|
|
use app\common\model\GoodsYong;
|
|
use app\common\model\Store;
|
|
use app\common\model\User;
|
|
|
|
class CouponReceive extends Base
|
|
{
|
|
/**
|
|
* 优惠券列表
|
|
*/
|
|
public function index(Request $request)
|
|
{
|
|
$keyword = trim(input('get.keyword'));
|
|
$status = trim(input('get.status'));
|
|
$user_id = trim(input('get.user_id'));
|
|
$whe = [];
|
|
if (!empty($keyword)) {
|
|
$whe[] = ['title', 'like', '%' . $keyword . '%'];
|
|
}
|
|
if ($user_id) {
|
|
$user_id = $user_id - 1260;
|
|
$whe[] = ['user_id', '=', $user_id];
|
|
}
|
|
if (!empty($status)) {
|
|
$whe[] = ['status', '=', $status - 1];
|
|
}
|
|
$field = "*";
|
|
$order = "addtime desc";
|
|
$data = CouponReceiveModel::getList($whe, $field, $order, $this->page);
|
|
foreach ($data['list'] as $key => $val) {
|
|
|
|
$user_info = User::getInfo(['id' => $val['user_id']]);
|
|
if (empty($user_info)) {
|
|
$user_info['nickname'] = '';
|
|
$user_info['headimg'] = '';
|
|
$user_info['mobile'] = '';
|
|
}
|
|
$data['list'][$key]['nickname'] = $user_info['nickname'];
|
|
// $val['user_id']=
|
|
}
|
|
View::assign('list', $data['list']);
|
|
View::assign('count', $data['count']);
|
|
View::assign('page', $data['page']);
|
|
return View::fetch("CouponReceive/index");
|
|
}
|
|
}
|