12345678910111213141516171819202122232425 |
- <?php
- namespace app\admin\controller\finance;
- use support\Db;
- class WriteOffController
- {
- public function records()
- {
- $sql = "select a.appointment_id as benefit_id,a.appointment_addtimes as addtimes,m.member_mobile,c.member_cert_name,b.member_benefit_name as benefit_name,a.appointment_done_json as used_json,a.appointment_done_datetime from app_appointment as a
- left join app_member as m on m.member_id = a.join_appointment_member_id
- left join app_member_cert as c on c.join_cert_member_id = a.join_appointment_member_id
- left join app_member_benefit as b on b.join_benefit_member_id = a.join_appointment_member_id
- UNION
- select q.member_quota_id as benefit_id,q.member_quota_addtimes as addtimes,q.member_quota_used_json as used_json, q.member_quota_name as benefit_name,m.member_mobile,c.member_cert_name from app_member_quota as q
- left join app_member as m on m.member_id = q.join_quota_member_id
- left join app_member_cert as c on c.join_cert_member_id = q.join_quota_member_id
- order by addtimes desc limit 0,10";
- $records = Db::select($sql);
- dump($records);
- }
- }
|