|
|
@@ -824,6 +824,33 @@ class User extends AuthController
|
|
|
}
|
|
|
|
|
|
|
|
|
+ public function add_member($id, $type)
|
|
|
+ {
|
|
|
+ if (!$type) $this->failed('请选择会员类型。');
|
|
|
+ if ($id && !MemberCheck::where('id', $id)->find()) {
|
|
|
+ $this->failed('记录状态错误。');
|
|
|
+ }
|
|
|
+ $info = $id ? MemberCheck::get($id) : [];
|
|
|
+ $member_grade = MemberGrade::where('type', $type)->field('grade as value,name as label')->select();
|
|
|
+ $f = [];
|
|
|
+// $f[] = Form::select('type', '会员类型', $info ? $info['type'] : 1)->setOptions([['value' => 1, 'label' => '个人会员'], ['value' => 2, 'label' => '企业会员']])->required();
|
|
|
+ $f[] = Form::input('name', $type == 1 ? '姓名' : '企业名', $info ? $info['name'] : '')->required();
|
|
|
+ $f[] = Form::input('idcard', $type == 1 ? '身份证号' : '企业统一代码', $info ? $info['idcard'] : '')->required();
|
|
|
+ $f[] = Form::input('phone', '联系方式', $info ? $info['phone'] : '')->required();
|
|
|
+ $f[] = Form::cityArea('city_picker', '地区', $info ? $info[''] . '/' . $info[''] . '/' . $info[''] : '')->required();
|
|
|
+ $f[] = Form::input('detail_address', '详细地址', $info ? $info['detail_address'] : '')->required();
|
|
|
+ $f[] = Form::input('job', $type == 1 ? '职业' : '主营业务', $info ? $info['job'] : '')->required();
|
|
|
+ $f[] = Form::number('job_year', $type == 1 ? '职业年限' : '公司年限', $info ? $info['job_year'] : '')->required();
|
|
|
+ $f[] = Form::input('saver', '保荐人', $info ? $info['saver'] : '')->required();
|
|
|
+ $f[] = Form::frameImageOne('logo', $type == 1 ? '半身照' : 'logo', Url::buildUrl('admin/widget.images/index', array('fodder' => 'logo')), $info ? $info['logo'] : '')->icon('image')->width('100%')->height('500px')->required();
|
|
|
+// $f[] = Form::radio('status', '状态', $info ? $info['status'] : '')->setOptions([['value' => 0, 'label' => '待审核'], ['value' => 1, 'label' => '通过'], ['value' => 2, 'label' => '驳回']])->required();
|
|
|
+ $f[] = Form::radio('grade', '会员等级', $info ? (string)$info['grade'] : '')->setOptions($member_grade)->required();
|
|
|
+ $form = Form::make_post_form('添加会员', $f, Url::buildUrl('save_member', array('id' => $id, 'type' => $type)));
|
|
|
+ $this->assign(compact('form'));
|
|
|
+ return $this->fetch('public/form-builder');
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
public function pass($id)
|
|
|
{
|
|
|
if (!$id || !MemberCheck::where('id', $id)->where('paid', 1)->where('status', 0)->find()) {
|
|
|
@@ -853,6 +880,7 @@ class User extends AuthController
|
|
|
}
|
|
|
//发消息
|
|
|
$info = MemberCheck::where('id', $id)->find();
|
|
|
+ if (!$info['order_id']) goto ens;
|
|
|
$refund_data['pay_price'] = $info['pay_money'];
|
|
|
$refund_data['refund_price'] = $info['pay_money'];
|
|
|
if ($info['pay_type'] == 'weixin') {
|
|
|
@@ -870,6 +898,7 @@ class User extends AuthController
|
|
|
BaseModel::checkTrans($res);
|
|
|
if (!$res) Json::fail('余额退款失败!');
|
|
|
}
|
|
|
+ ens:
|
|
|
$info->status = 2;
|
|
|
$res = $info->save();
|
|
|
if ($res) {
|