Commit 98edb9e3 authored by shajiaiming's avatar shajiaiming

Merge branch 'feature/optimize' into 'master'

推荐应用增加所属分类 See merge request !50
parents 2eebd9e6 609935e1
......@@ -56,8 +56,10 @@ class ApplicationController extends BaseController
if(Yii::$app->request->isPost){
Yii::$app->response->format = 'json';
$category_id = Yii::$app->request->get('category_id');
$fields = ['category_id','h5_icon','official_url','introduce_image','show_width','show_height','open_type', 'open_type_app', 'name','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type', 'platform_id'];
$params = array_merge(Yii::$app->request->post(),['category_id' => $category_id, 'platform_id' => Yii::$app->user->identity->platform_id]);
$fields = ['category_id','h5_icon','official_url','introduce_image','show_width','show_height','open_type', 'open_type_app', 'platform_type', 'name','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type', 'platform_id'];
$data = Yii::$app->request->post();
$data['open_type_app'] = (0 == $data['open_type_app']) ? 1 : $data['open_type_app'];
$params = array_merge($data,['category_id' => $category_id, 'platform_id' => Yii::$app->user->identity->platform_id]);
$params = $this->initParams($params, $fields);
$coin_applicateion_form = new CoinApplicationForm();
$coin_applicateion_form->setScenario(CoinApplicationForm::SCENARIO_ADD);
......@@ -80,8 +82,10 @@ class ApplicationController extends BaseController
{
if (Yii::$app->request->isPost) {
Yii::$app->response->format = 'json';
$fields = ['category_id','id','h5_icon','official_url','introduce_image','show_width','show_height','open_type', 'open_type_app', 'name','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type', 'platform_id'];
$params = array_merge(Yii::$app->request->post(),['platform_id' => Yii::$app->user->identity->platform_id]);
$fields = ['category_id','id','h5_icon','official_url','introduce_image','show_width','show_height','open_type', 'open_type_app','platform_type', 'name','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type', 'platform_id'];
$data = Yii::$app->request->post();
$data['open_type_app'] = (0 == $data['open_type_app']) ? 1 : $data['open_type_app'];
$params = array_merge($data,['platform_id' => Yii::$app->user->identity->platform_id]);
$params = $this->initParams($params, $fields);
$coin_applicateion_form = new CoinApplicationForm();
$coin_applicateion_form->setScenario(CoinApplicationForm::SCENARIO_EDIT);
......
......@@ -40,13 +40,14 @@ class CoinApplicationForm extends BaseForm
public $show_height;
public $open_type;
public $open_type_app;
public $platform_type;
public $platform_id;
public function scenarios()
{
return [
self::SCENARIO_ADD => ['category_id','name','h5_icon','official_url','introduce_image','show_width','show_height','open_type', 'open_type_app','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type', 'platform_id'],
self::SCENARIO_EDIT => ['category_id','id','h5_icon','official_url','introduce_image','show_width','show_height','open_type', 'open_type_app','name','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type', 'platform_id'],
self::SCENARIO_ADD => ['category_id','name','h5_icon','official_url','introduce_image','show_width','show_height','open_type', 'open_type_app', 'platform_type','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type', 'platform_id'],
self::SCENARIO_EDIT => ['category_id','id','h5_icon','official_url','introduce_image','show_width','show_height','open_type', 'open_type_app', 'platform_type','name','sort','icon','type','native_url','native_login_url','h5_url','android_url','ios_url','app_store_url','advertise','description','redirect_type', 'platform_id'],
];
}
......@@ -76,6 +77,7 @@ class CoinApplicationForm extends BaseForm
'show_height' => '显示高度',
'open_type' => 'H5打开方式 PC版',
'open_type_app' => 'H5打开方式 APP版',
'platform_type' => '所属平台',
'platform_id' => '平台Id'
];
}
......
......@@ -180,7 +180,15 @@
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">所属类型</label>
<div class="layui-input-block">
<select name="platform_type" >
<option value="1">币钱包</option>
<option value="2">托管账户</option>
</select>
</div>
</div>
<div class="layui-form-item">
<button class="layui-btn">提交</button>
</div>
......
......@@ -182,6 +182,15 @@
</select>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">所属类型</label>
<div class="layui-input-block">
<select name="platform_type" >
<option value="1" <?php if($item['platform_type'] ==1) echo "selected"?>>币钱包</option>
<option value="2" <?php if($item['platform_type'] ==2) echo "selected"?>>托管账户</option>
</select>
</div>
</div>
</form>
</div>
</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment