Commit d794e578 by guanzhenshan

搜索账户改为paypal账户

parent 0e9b8c8e
......@@ -100,6 +100,37 @@ namespace Bailun.DC.Services
}
/// <summary>
/// Paypal账户列表
/// </summary>
/// <param name="companyid">公司id</param>
/// <returns></returns>
public static List<string> ListPaypalAccount(int? companyid)
{
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
var sqlparam = new DynamicParameters();
var sql = "select account_name from dc_base_income_ebay_paypal where 1=1 ";
if (companyid.HasValue && companyid.Value > 0)
{
sql += " and company_id=" + companyid.Value;
}
sql += " group by account_name";
var obj = cn.Query<string>(sql, null, null, true, 2 * 60).AsList();
return obj;
}
}
/// <summary>
/// 获取平台站点列表
/// </summary>
/// <param name="platform">平台编码</param>
......
......@@ -3012,6 +3012,20 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
}
/// <summary>
/// paypal账号列表
/// </summary>
/// <returns></returns>
[BailunAuthentication(LoginMode.Enforce)]
[HttpPost]
public JsonResult ListPaypalAccount()
{
var companyid = HttpContextHelper.Current?.User?.GetCompanyId().ToInt32();
var result = Services.CommonServices.ListPaypalAccount(companyid);
return Json(result);
}
/// <summary>
/// 获取站点列表
/// </summary>
/// <param name="platform">平台编码</param>
......
......@@ -14,9 +14,9 @@
<form id="toolbar">
<div class="form-inline" style="line-height:40px;">
<div class="form-group">
<label>销售帐号:</label>
<label>Paypal帐号:</label>
<select id="account" name="account" class="form-control" style="width:160px;">
<option value="">选择帐号</option>
<option value="">选择Paypal帐号</option>
</select>
</div>
<div class="form-group">
......@@ -186,12 +186,12 @@
function listAccount() {
$.submit({
url: '@Url.Content("~/Reports/Orders/ListAccount")',
url: '@Url.Content("~/Reports/Orders/ListPaypalAccount")',
type:'POST',
paramData: 'platform=Ebay',
paramData: '',
func: function (result) {
if (result != null && result != undefined) {
$('#account').html('<option value="">选择帐号</option>');
$('#account').html('<option value="">选择Paypal帐号</option>');
for (var i = 0; i < result.length; i++) {
$('#account').append('<option value="' + result[i] + '">' + result[i]+'</option>');
}
......
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