| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- namespace app\common\model;
- class OrderAnnualFeeModel extends BaseModel
- {
- protected $table = 'erp_order_annual_fee';
- protected function genSchema(array $schema)
- {
- // TODO: Implement genSchema() method.
- }
- public function fetchByOrderIds($order_ids, $is_pay = 0) {
- return $this->where('is_delete', 0)
- ->where('order_id', 'in', $order_ids)
- ->where('is_pay', '=', $is_pay)
- ->select()->toArray();
- }
- public function fetchByAdviser($admin_id, $text = null, $start_time = null, $end_time = null, $page = 1, $size = 10) {
- $where = [
- ['is_delete', '=', 0],
- ['is_pay', '=', 0],
- ['adviser_1_id', '=', $admin_id],
- ];
- if ($text) array_push($where, ['customer_name|customer_mobile', 'like', "%".$text."%"]);
- if ($start_time) array_push($where, ['order_create_time', '>=', $start_time]);
- if ($end_time) array_push($where, ['order_create_time', '<=', $end_time]);
- return $this->where($where)
- ->page($page)
- ->paginate($size);
- }
- }
|