|
@@ -169,17 +169,23 @@ class AccountLogic extends BaseLogic
|
|
|
public static function batchLog(array $data = []): Json
|
|
|
{
|
|
|
$where = [];
|
|
|
- if ($data['company_id'] != '') $where[] = ['company_id', '=', $data['company_id']];
|
|
|
- if ($data['card_id'] != '') $where[] = ['card_id', '=', $data['card_id']];
|
|
|
+ if ($data['company_title'] != '') $where[] = ['b.title', 'like', '%' . $data['company_title'] . '%'];
|
|
|
+ if ($data['card_title'] != '') $where[] = ['c.title', 'like', '%' . $data['card_title'] . '%'];
|
|
|
|
|
|
$count = Db::name('account_batch_log')
|
|
|
+ ->alias('a')
|
|
|
+ ->leftJoin('company b', 'b.id=a.company_id AND b.is_del=' . CommonModel::$del_normal)
|
|
|
+ ->leftJoin('card c', 'c.id=a.card_id AND c.is_del=' . CommonModel::$del_normal)
|
|
|
->where($where)
|
|
|
- ->count('id');
|
|
|
+ ->count('a.id');
|
|
|
|
|
|
$list = Db::name('account_batch_log')
|
|
|
+ ->alias('a')
|
|
|
+ ->leftJoin('company b', 'b.id=a.company_id AND b.is_del=' . CommonModel::$del_normal)
|
|
|
+ ->leftJoin('card c', 'c.id=a.card_id AND c.is_del=' . CommonModel::$del_normal)
|
|
|
->where($where)
|
|
|
- ->field(true)
|
|
|
- ->order('id', 'desc')
|
|
|
+ ->field('a.id,b.title company_title,c.title card_title,a.username_prefix,a.username_year,a.starttime,a.expiretime')
|
|
|
+ ->order('a.id', 'desc')
|
|
|
->page($data['page'], $data['size'])
|
|
|
->select()
|
|
|
->toArray();
|