Commit cb3b2bd5 by 朱继来

调整样片列表申请数量(过滤已取消订单)

parent 2a7ddcec
Showing with 7 additions and 1 deletions
......@@ -110,7 +110,13 @@ class UserSampleApplyModel extends Model
// 获取指定字段的总数
public function getSampleApplySum($user_id, $field='apply_num')
{
return $this->where('user_id', $user_id)->sum($field);
return $this->from('lie_user_sample_apply as s')
->join('lie_order as o', 's.order_id', '=', 'o.order_id')
->where('s.user_id', '=', $user_id)
->where('o.status', '<>', '-1')
->sum('apply_num');
// return $this->where('user_id', $user_id)->sum($field);
}
// 获取指定用户申请的样片消耗总人数
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment