1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace App\Admin\Repositories;
- use App\Models\DistAppearanceVariable as Model;
- use Dcat\Admin\Form;
- use Dcat\Admin\Repositories\EloquentRepository;
- class DistAppearanceVariable extends EloquentRepository
- {
- /**
- * Model.
- *
- * @var string
- */
- protected $eloquentClass = Model::class;
- public static function getVariableRow($distId,$appearanceId,$templateId)
- {
- $model = new Model();
- $variable = $model->where('dist_id',$distId)->where('appearance_id',$appearanceId)->whereIn('template_id',[0,$templateId])->get();
- if($variable){
- return $variable;
- }else{
- return '';
- }
- }
- /*
- * 把原始变量复制给分销商
- */
- public static function copyAppearanceVariable($appearanceId, $distId){
- Model::copyAppearanceVariable($appearanceId, $distId);
- }
- /*
- * 删除分销商主题变量
- */
- public static function deleteVariable($appearanceId,$distId)
- {
- return Model::where('appearance_id', $appearanceId)->where('dist_id', $distId)->delete();
- }
- }
|