PayLogController.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace backend\modules\extend\controllers;
  3. use Yii;
  4. use common\models\base\SearchModel;
  5. use common\enums\StatusEnum;
  6. use common\models\extend\PayLog;
  7. use backend\controllers\BaseController;
  8. /**
  9. * Class PayLogController
  10. * @package backend\modules\extend\controllers
  11. * @author jianyan74 <751393839@qq.com>
  12. */
  13. class PayLogController extends BaseController
  14. {
  15. /**
  16. * @return string
  17. * @throws \yii\web\NotFoundHttpException
  18. */
  19. public function actionIndex()
  20. {
  21. $searchModel = new SearchModel([
  22. 'model' => PayLog::class,
  23. 'scenario' => 'default',
  24. 'partialMatchAttributes' => ['order_sn'], // 模糊查询
  25. 'defaultOrder' => [
  26. 'id' => SORT_DESC,
  27. ],
  28. 'pageSize' => $this->pageSize,
  29. ]);
  30. $dataProvider = $searchModel
  31. ->search(Yii::$app->request->queryParams);
  32. $dataProvider->query
  33. ->andWhere(['>=', 'status', StatusEnum::DISABLED])
  34. ->with(['member']);
  35. return $this->render($this->action->id, [
  36. 'dataProvider' => $dataProvider,
  37. 'searchModel' => $searchModel,
  38. ]);
  39. }
  40. /**
  41. * 行为日志详情
  42. *
  43. * @param $id
  44. * @return string
  45. */
  46. public function actionView($id)
  47. {
  48. return $this->renderAjax($this->action->id, [
  49. 'model' => PayLog::findOne($id),
  50. ]);
  51. }
  52. }
粤ICP备19079148号