12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- <?php
- /**
- *
- *
- * @category xxx
- * @package PSR
- * @subpackage Documentation\API
- * @author xxx <xxx@xxx.com>
- * @license GPL https://xxx.com
- * @link https://xxx.com
- * @ctime: 2020/5/19 9:36
- */
- namespace App\Repositories;
- use App\Models\PunishmentOrder;
- class PunishmentOrderRepository extends BaseRepository
- {
- public function __construct(PunishmentOrder $punishmentOrder)
- {
- $this->model = $punishmentOrder;
- }
- public function getAllByUserId($user_id){
- return $this->model->query()->where('user_id',$user_id)->paginate();
- }
- public function getModelByNo($no){
- return $this->model->query()->where('no',$no)->first();
- }
- public function isPay($no){
- return $this->model->query()->where('no',$no)->where('pay_status',PunishmentOrder::PAY_STATUS_OK)->first();
- }
- /**
- * checkNoPayModel
- *
- * @param $user_id
- * @return bool
- * @author Fx
- *
- */
- public function checkNoPayModel($user_id){
- $order = $this->model
- ->query()
- ->where('user_id',$user_id)
- ->where('pay_status',PunishmentOrder::PAY_STATUS_NO)
- ->first();
- return empty($order);
- }
- }
|