| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- namespace App\Module\Promotion\AdminControllers\Helper;
- use App\Module\Promotion\Enums\PROFIT_SOURCE_TYPE;
- use App\Module\Promotion\Enums\REFERRAL_CHANGE_REASON;
- use App\Module\Promotion\Enums\REFERRAL_CODE_STATUS;
- use App\Module\Promotion\Enums\REFERRAL_CODE_USAGE_STATUS;
- /**
- * 列表页辅助特性
- *
- * 提供列表页的辅助方法,如列的显示、格式化等。
- */
- trait GridHelperTrait
- {
- /**
- * 显示推荐码状态
- *
- * @param string $field 字段名
- * @param string $label 标签
- * @return \Dcat\Admin\Grid\Column
- */
- public function columnReferralCodeStatus(string $field = 'status', string $label = '状态')
- {
- return $this->grid->column($field, $label)->using(REFERRAL_CODE_STATUS::getOptions());
- }
- /**
- * 显示推荐码使用状态
- *
- * @param string $field 字段名
- * @param string $label 标签
- * @return \Dcat\Admin\Grid\Column
- */
- public function columnReferralCodeUsageStatus(string $field = 'status', string $label = '状态')
- {
- return $this->grid->column($field, $label)->using(REFERRAL_CODE_USAGE_STATUS::getOptions());
- }
- /**
- * 显示推荐关系修改原因
- *
- * @param string $field 字段名
- * @param string $label 标签
- * @return \Dcat\Admin\Grid\Column
- */
- public function columnReferralChangeReason(string $field = 'reason', string $label = '修改原因')
- {
- return $this->grid->column($field, $label)->using(REFERRAL_CHANGE_REASON::getOptions());
- }
- /**
- * 显示收益来源类型
- *
- * @param string $field 字段名
- * @param string $label 标签
- * @return \Dcat\Admin\Grid\Column
- */
- public function columnProfitSourceType(string $field = 'source_type', string $label = '来源类型')
- {
- return $this->grid->column($field, $label)->using(PROFIT_SOURCE_TYPE::getOptions());
- }
- }
|