master
wangxinglong 2021-12-22 16:19:36 +08:00
parent 766829c406
commit 3fa64cdd51
2 changed files with 4 additions and 5 deletions

View File

@ -39,14 +39,14 @@ class CouponRepository extends Repository
*/
public function couponMainHasList($id, $keyword, $page, $size)
{
return Coupon::findList(["id" => $id], [], $page, $size, function ($q) use ($keyword) {
return Coupon::findList(["coupon_id" => $id], ["*"], $page, $size, function ($q) use ($keyword) {
if (!empty($keyword)) {
return $q::hasWhere('account', function ($q) use ($keyword) {
$q->where('nick_name', 'like', "%" . $keyword . "%")->field("nick_name,avatar_url");
$q->where('nick_name', 'like', "%" . $keyword . "%")->field("nick_name,avatar_url,user_code");
});
} else {
return $q->with(["account" => function ($query) {
$query->field("nick_name,avatar_url");
$query->field("nick_name,avatar_url,user_code");
}]);
}
}, ["id" => "desc"]);

View File

@ -51,8 +51,7 @@
<!-- 操作列 -->
<script type="text/html" id="row-operate">
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="" data-title="详情" lay-event="">详情</a>
<a class="layui-btn layui-btn-primary layui-btn-xs" data-href="/manager/coupon/info.html?id={{d.id}}" data-title="【{{ d.name }}】详情" lay-event="info">详情</a>
</script>
<!-- 状态列 -->