| 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 ShowHelperTrait
- {
- /**
- * 显示推荐码状态
- *
- * @param string $field 字段名
- * @param string $label 标签
- * @return \Dcat\Admin\Show\Field
- */
- public function fieldReferralCodeStatus(string $field = 'status', string $label = '状态')
- {
- return $this->show->field($field, $label)->using(REFERRAL_CODE_STATUS::getOptions());
- }
- /**
- * 显示推荐码使用状态
- *
- * @param string $field 字段名
- * @param string $label 标签
- * @return \Dcat\Admin\Show\Field
- */
- public function fieldReferralCodeUsageStatus(string $field = 'status', string $label = '状态')
- {
- return $this->show->field($field, $label)->using(REFERRAL_CODE_USAGE_STATUS::getOptions());
- }
- /**
- * 显示推荐关系修改原因
- *
- * @param string $field 字段名
- * @param string $label 标签
- * @return \Dcat\Admin\Show\Field
- */
- public function fieldReferralChangeReason(string $field = 'reason', string $label = '修改原因')
- {
- return $this->show->field($field, $label)->using(REFERRAL_CHANGE_REASON::getOptions());
- }
- /**
- * 显示收益来源类型
- *
- * @param string $field 字段名
- * @param string $label 标签
- * @return \Dcat\Admin\Show\Field
- */
- public function fieldProfitSourceType(string $field = 'source_type', string $label = '来源类型')
- {
- return $this->show->field($field, $label)->using(PROFIT_SOURCE_TYPE::getOptions());
- }
- }
|