Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
b8c6c914
Commit
b8c6c914
authored
Sep 05, 2018
by
hujun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
随机图片
parent
1d4af662
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
17 deletions
+43
-17
GHouses.php
application/model/GHouses.php
+43
-17
No files found.
application/model/GHouses.php
View file @
b8c6c914
...
...
@@ -646,13 +646,6 @@ class GHouses extends BaseModel
$save_data
[
'shop_sign'
]
=
$data
[
'shop_sign'
];
}
//C端随机图片
if
(
empty
(
$data
[
'is_show'
])
&&
!
empty
(
$save_data
[
'shop_sign'
]))
{
$shop_sign
=
explode
(
','
,
$save_data
[
'shop_sign'
]);
$image
=
new
ImageDepotService
();
$save_data
[
'external_image_id'
]
=
$image
->
getImage
(
$shop_sign
[
0
]);
}
//物业管理费 金额 存分
if
(
isset
(
$data
[
'management_fee'
]))
{
$save_data
[
'management_fee'
]
=
$data
[
'management_fee'
]
*
100
;
...
...
@@ -762,6 +755,14 @@ class GHouses extends BaseModel
if
(
empty
(
$data
[
'id'
]))
{
$save_data
[
'upload_id'
]
=
$agent_id
;
//上传人
$save_data
[
'create_time'
]
=
date
(
'Y-m-d H:i:s'
);
//C端随机图片
if
(
empty
(
$data
[
'is_show'
])
&&
!
empty
(
$save_data
[
'industry_type'
]))
{
$industry_type
=
explode
(
','
,
$save_data
[
'industry_type'
]);
$image
=
new
ImageDepotService
();
$save_data
[
'external_image_id'
]
=
$image
->
getImage
(
$industry_type
[
0
]);
}
$house_id
=
$this
->
insertGetId
(
$save_data
);
}
else
{
//操作人
...
...
@@ -769,9 +770,23 @@ class GHouses extends BaseModel
$save_data
[
'operation_id'
]
=
$data
[
'user_id'
];
}
$save_data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
);
$this
->
where
(
'id'
,
$data
[
'id'
])
->
update
(
$save_data
);
$house_id
=
$data
[
'id'
];
try
{
$house_data
=
$this
->
field
(
'id,external_image_id'
)
->
where
(
'id'
,
$data
[
'id'
])
->
find
();
//C端随机图片
if
(
empty
(
$data
[
'is_show'
])
&&
!
empty
(
$save_data
[
'industry_type'
])
&&
empty
(
$house_data
[
'external_image_id'
]))
{
$industry_type
=
explode
(
','
,
$save_data
[
'industry_type'
]);
$image
=
new
ImageDepotService
();
$save_data
[
'external_image_id'
]
=
$image
->
getImage
(
$industry_type
[
0
]);
}
$save_data
[
'update_time'
]
=
date
(
'Y-m-d H:i:s'
);
$this
->
where
(
'id'
,
$data
[
'id'
])
->
update
(
$save_data
);
$house_id
=
$data
[
'id'
];
}
catch
(
\Exception
$e
)
{
$house_id
=
0
;
}
}
return
$house_id
;
...
...
@@ -1367,12 +1382,6 @@ class GHouses extends BaseModel
$shop_sign
[
$k
]
=
'百货超市'
;
}
}
//C端随机图片
if
(
empty
(
$data
[
'is_show'
])
&&
!
empty
(
$params
[
'shop_sign'
]))
{
$image
=
new
ImageDepotService
();
$params
[
'external_image_id'
]
=
$image
->
getImage
(
$shop_sign
[
0
]);
}
}
$params
[
'shop_sign'
]
=
implode
(
','
,
$shop_sign
);
...
...
@@ -1380,12 +1389,29 @@ class GHouses extends BaseModel
//新增或编辑
if
(
empty
(
$params
[
'id'
]))
{
$params
[
'upload_id'
]
=
$agent_id
;
//C端随机图片
if
(
empty
(
$data
[
'is_show'
])
&&
!
empty
(
$params
[
'industry_type'
]))
{
$industry_type
=
explode
(
','
,
$params
[
'industry_type'
]);
$image
=
new
ImageDepotService
();
$params
[
'external_image_id'
]
=
$image
->
getImage
(
$industry_type
[
0
]);
}
$this
->
allowField
(
true
)
->
save
(
$params
);
$house_id
=
$this
->
id
;
$result
[
'house_id'
]
=
$this
->
id
;
$result
[
'internal_title'
]
=
$params
[
'internal_title'
];
}
else
{
$house_data
=
$this
->
field
(
'id,internal_title,residue_num,total'
)
->
where
(
'id'
,
$params
[
'id'
])
->
where
(
'status'
,
'<>'
,
3
)
->
find
();
$house_data
=
$this
->
field
(
'id,internal_title,residue_num,total,external_image_id'
)
->
where
(
'id'
,
$params
[
'id'
])
->
where
(
'status'
,
'<>'
,
3
)
->
find
();
//C端随机图片
if
(
empty
(
$data
[
'is_show'
])
&&
!
empty
(
$save_data
[
'industry_type'
])
&&
empty
(
$house_data
[
'external_image_id'
]))
{
$industry_type
=
explode
(
','
,
$save_data
[
'industry_type'
]);
$image
=
new
ImageDepotService
();
$save_data
[
'external_image_id'
]
=
$image
->
getImage
(
$industry_type
[
0
]);
}
if
(
!
empty
(
$house_data
[
'id'
]))
{
$params
[
'operation_id'
]
=
$params
[
'userId'
];
$this
->
allowField
(
true
)
->
isUpdate
(
true
)
->
save
(
$params
,
[
'id'
=>
$params
[
'id'
]
]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment